From e91aec98ff2e2399f3891b2c7c381cfed993f3b2 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Fri, 20 Dec 2024 11:50:08 +0100 Subject: [PATCH] Remove default-config and validate sub-commands They have been deprecated and hidden for a very long time. Signed-off-by: Tom Wieczorek --- cmd/root.go | 11 ----------- cmd/validate/validate.go | 42 ---------------------------------------- 2 files changed, 53 deletions(-) delete mode 100644 cmd/validate/validate.go diff --git a/cmd/root.go b/cmd/root.go index 25e207d9abb0..9349b5427be7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -39,7 +39,6 @@ import ( "github.com/k0sproject/k0s/cmd/stop" "github.com/k0sproject/k0s/cmd/sysinfo" "github.com/k0sproject/k0s/cmd/token" - "github.com/k0sproject/k0s/cmd/validate" "github.com/k0sproject/k0s/cmd/version" "github.com/k0sproject/k0s/cmd/worker" k0slog "github.com/k0sproject/k0s/internal/pkg/log" @@ -104,12 +103,10 @@ func NewRootCmd() *cobra.Command { cmd.AddCommand(stop.NewStopCmd()) cmd.AddCommand(sysinfo.NewSysinfoCmd()) cmd.AddCommand(token.NewTokenCmd()) - cmd.AddCommand(validate.NewValidateCmd()) // hidden+deprecated cmd.AddCommand(version.NewVersionCmd()) cmd.AddCommand(worker.NewWorkerCmd()) cmd.AddCommand(newCompletionCmd()) - cmd.AddCommand(newDefaultConfigCmd()) // hidden+deprecated cmd.AddCommand(newDocsCmd()) cmd.DisableAutoGenTag = true @@ -139,14 +136,6 @@ func newDocsCmd() *cobra.Command { } } -func newDefaultConfigCmd() *cobra.Command { - cmd := configcmd.NewCreateCmd() - cmd.Hidden = true - cmd.Deprecated = "use 'k0s config create' instead" - cmd.Use = "default-config" - return cmd -} - func newCompletionCmd() *cobra.Command { return &cobra.Command{ Use: "completion ", diff --git a/cmd/validate/validate.go b/cmd/validate/validate.go deleted file mode 100644 index a550a66e2f23..000000000000 --- a/cmd/validate/validate.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2021 k0s authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package validate - -import ( - configcmd "github.com/k0sproject/k0s/cmd/config" - - "github.com/spf13/cobra" -) - -// TODO deprecated, remove when appropriate -func NewValidateCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "validate", - Short: "Validation related sub-commands", - Hidden: true, - } - cmd.AddCommand(newConfigCmd()) - return cmd -} - -func newConfigCmd() *cobra.Command { - cmd := configcmd.NewValidateCmd() - cmd.Use = "config" - cmd.Deprecated = "use 'k0s config validate' instead" - cmd.Hidden = false - return cmd -}