mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 06:43:54 +00:00
Sort default cidrs for reproducible builds
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.
This commit is contained in:
parent
bb72237375
commit
62f45189e1
@ -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