diff --git a/cmd/kubectl-testkube/commands/context/set.go b/cmd/kubectl-testkube/commands/context/set.go index 452924d0d4d..35a02508a92 100644 --- a/cmd/kubectl-testkube/commands/context/set.go +++ b/cmd/kubectl-testkube/commands/context/set.go @@ -43,7 +43,7 @@ func NewSetContextCmd() *cobra.Command { switch cfg.ContextType { case config.ContextTypeCloud: if opts.Master.OrgId == "" && opts.Master.EnvId == "" && apiKey == "" && opts.Master.RootDomain == "" { - ui.Errf("Please provide at least one of the following flags: --org, --env, --api-key, --root-domain") + ui.Errf("Please provide at least one of the following flags: --org-id, --env-id, --api-key, --root-domain") } cfg = common.PopulateCloudConfig(cfg, apiKey, &opts) diff --git a/cmd/kubectl-testkube/commands/pro/init.go b/cmd/kubectl-testkube/commands/pro/init.go index f13112e6c78..f6f0866d473 100644 --- a/cmd/kubectl-testkube/commands/pro/init.go +++ b/cmd/kubectl-testkube/commands/pro/init.go @@ -13,6 +13,7 @@ import ( func NewInitCmd() *cobra.Command { var export bool + var noLogin bool // ignore ask for login options := common.HelmOptions{ NoMinio: true, NoMongo: true, @@ -71,6 +72,14 @@ func NewInitCmd() *cobra.Command { ui.NL() + if noLogin { + ui.Alert("Saving Testkube CLI Pro context, you need to authorize CLI through `testkube set context` later") + common.PopulateCloudConfig(cfg, "", &options) + ui.Info(" Happy Testing! 🚀") + ui.NL() + return + } + ui.H2("Saving Testkube CLI Pro context") var token, refreshToken string if !common.IsUserLoggedIn(cfg, options) { @@ -91,6 +100,7 @@ func NewInitCmd() *cobra.Command { common.PopulateHelmFlags(cmd, &options) common.PopulateMasterFlags(cmd, &options) + cmd.Flags().BoolVarP(&noLogin, "no-login", "", false, "Ignore login prompt, set existing token later by `testkube set context`") cmd.Flags().BoolVarP(&export, "export", "", false, "Export the values.yaml") cmd.Flags().BoolVar(&options.MultiNamespace, "multi-namespace", false, "multi namespace mode") cmd.Flags().BoolVar(&options.NoOperator, "no-operator", false, "should operator be installed (for more instances in multi namespace mode it should be set to true)")