diff --git a/app/kumactl/cmd/install/install.go b/app/kumactl/cmd/install/install.go index 82566ce514c1..49b57833c5b6 100644 --- a/app/kumactl/cmd/install/install.go +++ b/app/kumactl/cmd/install/install.go @@ -12,6 +12,7 @@ func NewInstallCmd(pctx *kumactl_cmd.RootContext) *cobra.Command { Short: "Install various Kuma components.", Long: `Install various Kuma components.`, } + // sub-commands cmd.AddCommand(newInstallControlPlaneCmd(&pctx.InstallCpContext)) cmd.AddCommand(newInstallCrdsCmd(&pctx.InstallCRDContext)) @@ -19,8 +20,9 @@ func NewInstallCmd(pctx *kumactl_cmd.RootContext) *cobra.Command { cmd.AddCommand(newInstallTracing(pctx)) cmd.AddCommand(newInstallDNS()) cmd.AddCommand(newInstallLogging(pctx)) - cmd.AddCommand(newInstallTransparentProxy()) cmd.AddCommand(newInstallDemoCmd(&pctx.InstallDemoContext)) cmd.AddCommand(newInstallGatewayCmd(pctx)) + cmd.AddCommand(newInstallTransparentProxy()) + return cmd } diff --git a/app/kumactl/cmd/install/install_transparent_proxy.go b/app/kumactl/cmd/install/install_transparent_proxy.go index b3a7108c78e2..37943bd7f651 100644 --- a/app/kumactl/cmd/install/install_transparent_proxy.go +++ b/app/kumactl/cmd/install/install_transparent_proxy.go @@ -1,3 +1,5 @@ +// +build !windows + package install import ( diff --git a/app/kumactl/cmd/install/install_transparent_proxy_windows.go b/app/kumactl/cmd/install/install_transparent_proxy_windows.go new file mode 100644 index 000000000000..4509a3f75df1 --- /dev/null +++ b/app/kumactl/cmd/install/install_transparent_proxy_windows.go @@ -0,0 +1,16 @@ +package install + +import ( + "github.com/pkg/errors" + "github.com/spf13/cobra" +) + +func newInstallTransparentProxy() *cobra.Command { + return &cobra.Command{ + Use: "transparent-proxy", + Short: "Install Transparent Proxy pre-requisites on the host", + RunE: func(_ *cobra.Command, _ []string) error { + return errors.New("This command is not supported on your operating system") + }, + } +} diff --git a/app/kumactl/cmd/root.go b/app/kumactl/cmd/root.go index b2f63411eb19..fd2d13dd9602 100644 --- a/app/kumactl/cmd/root.go +++ b/app/kumactl/cmd/root.go @@ -106,8 +106,9 @@ func NewRootCmd(root *kumactl_cmd.RootContext) *cobra.Command { cmd.AddCommand(get.NewGetCmd(root)) cmd.AddCommand(inspect.NewInspectCmd(root)) cmd.AddCommand(install.NewInstallCmd(root)) - cmd.AddCommand(uninstall.NewUninstallCmd(root)) + cmd.AddCommand(uninstall.NewUninstallCmd()) cmd.AddCommand(version.NewVersionCmd()) + kumactl_cmd.WrapRunnables(cmd, kumactl_errors.FormatErrorWrapper) return cmd } diff --git a/app/kumactl/cmd/uninstall/uninstall.go b/app/kumactl/cmd/uninstall/uninstall.go index badaa21d5994..1e0f4b981f35 100644 --- a/app/kumactl/cmd/uninstall/uninstall.go +++ b/app/kumactl/cmd/uninstall/uninstall.go @@ -2,17 +2,17 @@ package uninstall import ( "github.com/spf13/cobra" - - kumactl_cmd "github.com/kumahq/kuma/app/kumactl/pkg/cmd" ) -func NewUninstallCmd(pctx *kumactl_cmd.RootContext) *cobra.Command { +func NewUninstallCmd() *cobra.Command { cmd := &cobra.Command{ Use: "uninstall", Short: "Uninstall various Kuma components.", Long: `Uninstall various Kuma components.`, } + // sub-commands cmd.AddCommand(newUninstallTransparentProxy()) + return cmd } diff --git a/app/kumactl/cmd/uninstall/uninstall_transparent_proxy.go b/app/kumactl/cmd/uninstall/uninstall_transparent_proxy.go index 2484f59996e4..b2a6c5a00239 100644 --- a/app/kumactl/cmd/uninstall/uninstall_transparent_proxy.go +++ b/app/kumactl/cmd/uninstall/uninstall_transparent_proxy.go @@ -1,3 +1,5 @@ +// +build !windows + package uninstall import ( @@ -11,13 +13,13 @@ import ( "github.com/kumahq/kuma/pkg/transparentproxy" ) -type transparenProxyArgs struct { +type transparentProxyArgs struct { DryRun bool Verbose bool } func newUninstallTransparentProxy() *cobra.Command { - args := transparenProxyArgs{ + args := transparentProxyArgs{ DryRun: false, Verbose: false, } diff --git a/app/kumactl/cmd/uninstall/uninstall_transparent_proxy_windows.go b/app/kumactl/cmd/uninstall/uninstall_transparent_proxy_windows.go new file mode 100644 index 000000000000..a540fb4556de --- /dev/null +++ b/app/kumactl/cmd/uninstall/uninstall_transparent_proxy_windows.go @@ -0,0 +1,16 @@ +package uninstall + +import ( + "github.com/pkg/errors" + "github.com/spf13/cobra" +) + +func newUninstallTransparentProxy() *cobra.Command { + return &cobra.Command{ + Use: "transparent-proxy", + Short: "Uninstall Transparent Proxy pre-requisites on the host", + RunE: func(_ *cobra.Command, _ []string) error { + return errors.New("This command is not supported on your operating system") + }, + } +} diff --git a/pkg/config/xds/bootstrap/config.go b/pkg/config/xds/bootstrap/config.go index a13abb5439bf..58dbb685f843 100644 --- a/pkg/config/xds/bootstrap/config.go +++ b/pkg/config/xds/bootstrap/config.go @@ -2,6 +2,7 @@ package bootstrap import ( "net" + "os" "time" "github.com/pkg/errors" @@ -88,9 +89,9 @@ func DefaultBootstrapParamsConfig() *BootstrapParamsConfig { return &BootstrapParamsConfig{ AdminAddress: "127.0.0.1", // by default, Envoy Admin interface should listen on loopback address AdminPort: 0, // by default, turn off Admin interface of Envoy - AdminAccessLogPath: "/dev/null", - XdsHost: "", // by default it is the same host as the one used by kuma-dp to connect to the control plane - XdsPort: 0, // by default it is autoconfigured from KUMA_XDS_SERVER_GRPC_PORT + AdminAccessLogPath: os.DevNull, + XdsHost: "", // by default, it is the same host as the one used by kuma-dp to connect to the control plane + XdsPort: 0, // by default, it is autoconfigured from KUMA_XDS_SERVER_GRPC_PORT XdsConnectTimeout: 1 * time.Second, } }