Remove kubeconfig from config struct

Change-Id: I5ab8722dd151d9e652e0b20e1d82988cd98505af
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This commit is contained in:
Ruslan Aliev
2020-09-15 15:05:52 -05:00
parent 10620da2cc
commit fc33287204
69 changed files with 157 additions and 359 deletions

View File

@@ -19,8 +19,6 @@ import (
"path/filepath"
"github.com/spf13/cobra"
"k8s.io/client-go/tools/clientcmd"
// Import to initialize client auth plugins.
_ "k8s.io/client-go/plugin/pkg/client/auth"
@@ -40,14 +38,13 @@ import (
type RootOptions struct {
Debug bool
AirshipConfigPath string
KubeConfigPath string
}
// NewAirshipCTLCommand creates a root `airshipctl` command with the default commands attached
func NewAirshipCTLCommand(out io.Writer) *cobra.Command {
rootCmd, settings := NewRootCommand(out)
return AddDefaultAirshipCTLCommands(rootCmd,
cfg.CreateFactory(&settings.AirshipConfigPath, &settings.KubeConfigPath))
cfg.CreateFactory(&settings.AirshipConfigPath))
}
// NewRootCommand creates the root `airshipctl` command. All other commands are
@@ -97,11 +94,4 @@ func initFlags(options *RootOptions, cmd *cobra.Command) {
"airshipconf",
"",
`Path to file for airshipctl configuration. (default "`+defaultAirshipConfigPath+`")`)
defaultKubeConfigPath := filepath.Join(defaultAirshipConfigDir, cfg.AirshipKubeConfig)
flags.StringVar(
&options.KubeConfigPath,
clientcmd.RecommendedConfigPathFlag,
"",
`Path to kubeconfig associated with airshipctl configuration. (default "`+defaultKubeConfigPath+`")`)
}