Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vendor: github.com/spf13/pflag v1.0.6, remove local IPNetSliceVar fork #5817

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

thaJeztah
Copy link
Member


vendor: github.com/spf13/pflag v1.0.6, remove local IPNetSliceVar fork

  • Add exported functions to preserve pkg/flag compatibility
  • Add IPNetSlice and unit tests
  • Revert the local fork added in 80a2256, which was pending the upstream feature to be shipped in a release.

full diff: spf13/pflag@v1.0.5...v1.0.6

Revert "Swarm init: use local IPNetSliceValue"

This reverts commit 80a2256.

- Description for the changelog

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

- Add exported functions to preserve pkg/flag compatibility
- Add IPNetSlice and unit tests
- Revert the local fork added in 80a2256,
  which was pending the upstream feature to be shipped in a release.

full diff: spf13/pflag@v1.0.5...v1.0.6

Revert "Swarm init: use local IPNetSliceValue"

This reverts commit 80a2256.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 28.0.0 milestone Feb 11, 2025
@thaJeztah thaJeztah self-assigned this Feb 11, 2025
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping putting them in the same commit would make git / github show this as a lateral move, as they were mostly identical originally, but possibly som changes were made after to make them different enough to not being shown as a "move" 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, probably because I used a minimal fork, and didn't include everything, that would explain

@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.25%. Comparing base (0af65dc) to head (558ebd5).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5817      +/-   ##
==========================================
- Coverage   59.28%   59.25%   -0.03%     
==========================================
  Files         353      352       -1     
  Lines       29550    29496      -54     
==========================================
- Hits        17518    17479      -39     
+ Misses      11052    11042      -10     
+ Partials      980      975       -5     

@@ -57,7 +57,7 @@ func newInitCommand(dockerCli command.Cli) *cobra.Command {
flags.BoolVar(&opts.forceNewCluster, "force-new-cluster", false, "Force create a new cluster from current state")
flags.BoolVar(&opts.autolock, flagAutolock, false, "Enable manager autolocking (requiring an unlock key to start a stopped manager)")
flags.StringVar(&opts.availability, flagAvailability, "active", `Availability of the node ("active", "pause", "drain")`)
flags.Var(newIPNetSliceValue([]net.IPNet{}, &opts.defaultAddrPools), flagDefaultAddrPool, "default address pool in CIDR format")
flags.IPNetSliceVar(&opts.defaultAddrPools, flagDefaultAddrPool, []net.IPNet{}, "default address pool in CIDR format")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future self; I wonder if nil vs []net.IPNet{} makes a difference for "default"; this was what we had before we added the fork, so I used that, but wasn't 100% sure if it made a difference.

@thaJeztah thaJeztah merged commit 516e822 into docker:master Feb 11, 2025
104 checks passed
@thaJeztah thaJeztah deleted the bump_pflag branch February 11, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

un-fork github.com/spf13/pflag IPNetSliceValue
3 participants