mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 13:55:41 +00:00
Merge pull request #57008 from dims/sort-cidrs-for-reproducible-build
Automatic merge from submit-queue (batch tested with PRs 56997, 57008, 56984, 56975, 56955). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Sort default cidrs for reproducible builds **What this PR does / why we need it**: In different distros or environments, we may end up with a different order of the default string printed during help and man page generation, So we should sort so the string we print is the same everytime. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #52269 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
b0a17e4e4d
@ -20,6 +20,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
@ -62,7 +63,9 @@ func init() {
|
|||||||
|
|
||||||
// String is the method to format the flag's value, part of the flag.Value interface.
|
// String is the method to format the flag's value, part of the flag.Value interface.
|
||||||
func (c *cidrs) String() string {
|
func (c *cidrs) String() string {
|
||||||
return strings.Join(c.ipn.StringSlice(), ",")
|
s := c.ipn.StringSlice()
|
||||||
|
sort.Strings(s)
|
||||||
|
return strings.Join(s, ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set supports a value of CSV or the flag repeated multiple times
|
// Set supports a value of CSV or the flag repeated multiple times
|
||||||
|
Loading…
Reference in New Issue
Block a user