pkg/mesh: rename mesh granularity types
This commit renames the mesh granularity types to make them more intuitive. The functionality provided by them remains exactly the same.
This commit is contained in:
@@ -59,8 +59,8 @@ var (
|
||||
string(mesh.AlwaysEncapsulate),
|
||||
}, ", ")
|
||||
availableGranularities = strings.Join([]string{
|
||||
string(mesh.DataCenterGranularity),
|
||||
string(mesh.NodeGranularity),
|
||||
string(mesh.LogicalGranularity),
|
||||
string(mesh.FullGranularity),
|
||||
}, ", ")
|
||||
availableLogLevels = strings.Join([]string{
|
||||
logLevelAll,
|
||||
@@ -78,7 +78,7 @@ func Main() error {
|
||||
cni := flag.Bool("cni", true, "Should Kilo manage the node's CNI configuration.")
|
||||
cniPath := flag.String("cni-path", mesh.DefaultCNIPath, "Path to CNI config.")
|
||||
encapsulate := flag.String("encapsulate", string(mesh.AlwaysEncapsulate), fmt.Sprintf("When should Kilo encapsulate packets within a location. Possible values: %s", availableEncapsulations))
|
||||
granularity := flag.String("mesh-granularity", string(mesh.DataCenterGranularity), fmt.Sprintf("The granularity of the network mesh to create. Possible values: %s", availableGranularities))
|
||||
granularity := flag.String("mesh-granularity", string(mesh.LogicalGranularity), fmt.Sprintf("The granularity of the network mesh to create. Possible values: %s", availableGranularities))
|
||||
kubeconfig := flag.String("kubeconfig", "", "Path to kubeconfig.")
|
||||
hostname := flag.String("hostname", "", "Hostname of the node on which this process is running.")
|
||||
listen := flag.String("listen", ":1107", "The address at which to listen for health and metrics.")
|
||||
@@ -140,8 +140,8 @@ func Main() error {
|
||||
|
||||
gr := mesh.Granularity(*granularity)
|
||||
switch gr {
|
||||
case mesh.DataCenterGranularity:
|
||||
case mesh.NodeGranularity:
|
||||
case mesh.LogicalGranularity:
|
||||
case mesh.FullGranularity:
|
||||
default:
|
||||
return fmt.Errorf("mesh granularity %v unknown; possible values are: %s", *granularity, availableGranularities)
|
||||
}
|
||||
|
@@ -45,8 +45,8 @@ var (
|
||||
k8s.Backend,
|
||||
}, ", ")
|
||||
availableGranularities = strings.Join([]string{
|
||||
string(mesh.DataCenterGranularity),
|
||||
string(mesh.NodeGranularity),
|
||||
string(mesh.LogicalGranularity),
|
||||
string(mesh.FullGranularity),
|
||||
}, ", ")
|
||||
availableLogLevels = strings.Join([]string{
|
||||
logLevelAll,
|
||||
@@ -76,8 +76,8 @@ func runRoot(_ *cobra.Command, _ []string) error {
|
||||
|
||||
opts.granularity = mesh.Granularity(granularity)
|
||||
switch opts.granularity {
|
||||
case mesh.DataCenterGranularity:
|
||||
case mesh.NodeGranularity:
|
||||
case mesh.LogicalGranularity:
|
||||
case mesh.FullGranularity:
|
||||
default:
|
||||
return fmt.Errorf("mesh granularity %v unknown; posible values are: %s", granularity, availableGranularities)
|
||||
}
|
||||
@@ -115,7 +115,7 @@ func main() {
|
||||
Version: version.Version,
|
||||
}
|
||||
cmd.PersistentFlags().StringVar(&backend, "backend", k8s.Backend, fmt.Sprintf("The backend for the mesh. Possible values: %s", availableBackends))
|
||||
cmd.PersistentFlags().StringVar(&granularity, "mesh-granularity", string(mesh.DataCenterGranularity), fmt.Sprintf("The granularity of the network mesh to create. Possible values: %s", availableGranularities))
|
||||
cmd.PersistentFlags().StringVar(&granularity, "mesh-granularity", string(mesh.LogicalGranularity), fmt.Sprintf("The granularity of the network mesh to create. Possible values: %s", availableGranularities))
|
||||
cmd.PersistentFlags().StringVar(&kubeconfig, "kubeconfig", os.Getenv("KUBECONFIG"), "Path to kubeconfig.")
|
||||
cmd.PersistentFlags().StringVar(&subnet, "subnet", "10.4.0.0/16", "CIDR from which to allocate addressees to WireGuard interfaces.")
|
||||
|
||||
|
Reference in New Issue
Block a user