diff --git a/cmd/kgctl/main.go b/cmd/kgctl/main.go index 9a6c58a..8e3477c 100644 --- a/cmd/kgctl/main.go +++ b/cmd/kgctl/main.go @@ -49,6 +49,7 @@ var ( availableGranularities = strings.Join([]string{ string(mesh.LogicalGranularity), string(mesh.FullGranularity), + string(mesh.CrossGranularity), string(mesh.AutoGranularity), }, ", ") availableLogLevels = strings.Join([]string{ @@ -80,6 +81,7 @@ func runRoot(c *cobra.Command, _ []string) error { switch opts.granularity { case mesh.LogicalGranularity: case mesh.FullGranularity: + case mesh.CrossGranularity: case mesh.AutoGranularity: default: return fmt.Errorf("mesh granularity %s unknown; posible values are: %s", granularity, availableGranularities) @@ -151,8 +153,9 @@ func determineGranularity(gr mesh.Granularity, ns []*mesh.Node) (mesh.Granularit switch ret { case mesh.LogicalGranularity: case mesh.FullGranularity: + case mesh.CrossGranularity: default: - return ret, fmt.Errorf("mesh granularity %s is not supported", opts.granularity) + return ret, fmt.Errorf("mesh granularity %s is not supported", ret) } return ret, nil } diff --git a/docs/kg.md b/docs/kg.md index 9d6f071..ac7c358 100644 --- a/docs/kg.md +++ b/docs/kg.md @@ -48,7 +48,7 @@ Flags: --local Should Kilo manage routes within a location? (default true) --log-level string Log level to use. Possible values: all, debug, info, warn, error, none (default "info") --master string The address of the Kubernetes API server (overrides any value in kubeconfig). - --mesh-granularity string The granularity of the network mesh to create. Possible values: location, full (default "location") + --mesh-granularity string The granularity of the network mesh to create. Possible values: location, full, cross (default "location") --mtu uint The MTU of the WireGuard interface created by Kilo. (default 1420) --port int The port over which WireGuard peers should communicate. (default 51820) --prioritise-private-addresses Prefer to assign a private IP address to the node's endpoint. diff --git a/pkg/k8s/backend.go b/pkg/k8s/backend.go index e94a664..c225bd9 100644 --- a/pkg/k8s/backend.go +++ b/pkg/k8s/backend.go @@ -334,6 +334,7 @@ func translateNode(node *v1.Node, topologyLabel string) *mesh.Node { switch meshGranularity { case mesh.LogicalGranularity: case mesh.FullGranularity: + case mesh.CrossGranularity: default: meshGranularity = "" }