Skip to content

Conversation

@thaJeztah
Copy link
Member

api/types/container: NetworkMode.NetworkName: use switch

  • Use a switch instead of if/else for readability and to reduce
    the risk of duplicates in the checks.
  • Align order between Windows and Linux implementation for easier
    comparing of differences in the implementation.
  • Add a check for IsHost() in the Windows implementation which
    would never occur currently, but is implemented.

api/types/container: NetworkMode align code between Windows and Linux

Change the order of declarations betwen both implementations for easier
comparing of differences.

- A picture of a cute animal (not mandatory but encouraged)

- Use a switch instead of if/else for readability and to reduce
  the risk of duplicates in the checks.
- Align order between Windows and Linux implementation for easier
  comparing of differences in the implementation.
- Add a check for `IsHost()` in the Windows implementation which
  would never occur currently, but is implemented.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Change the order of declarations betwen both implementations for easier
comparing of differences.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

Failure is unrelated; TestAPISwarmNodeDrainPause is a known flaky test; #23516

@thaJeztah thaJeztah merged commit eb360ef into moby:master Jun 17, 2024
@thaJeztah thaJeztah deleted the reformat_networkmodes branch June 17, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API area/networking Networking kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants