From d75142cc4e391dc52feee55127bf8845e03fb1b4 Mon Sep 17 00:00:00 2001 From: Ketan Umare <16888709+kumare3@users.noreply.github.com> Date: Fri, 19 Aug 2022 02:32:29 -0700 Subject: [PATCH] 3 usability improvements -Named executions, improved connection handling and better logging (#349) * Flytectl will clearly print the endpoint that is unable to connect to https://github.com/flyteorg/flyte/issues/2762 Signed-off-by: Ketan Umare * Use an optional name argument to run an execution Signed-off-by: Ketan Umare * Support for skipping initializing flyte client Signed-off-by: Ketan Umare Signed-off-by: Ketan Umare --- flytectl/cmd/compile/compile.go | 1 + flytectl/cmd/core/cmd.go | 32 ++++++++++++++++++---- flytectl/cmd/core/cmd_ctx.go | 21 ++++++++++---- flytectl/cmd/create/execution.go | 30 ++++++++++++++------ flytectl/cmd/create/execution_util.go | 21 ++++++++------ flytectl/cmd/create/execution_util_test.go | 24 ++++++++-------- flytectl/cmd/demo/demo.go | 6 ++-- flytectl/cmd/sandbox/sandbox.go | 6 ++-- flytectl/cmd/upgrade/upgrade.go | 11 ++++++-- 9 files changed, 103 insertions(+), 49 deletions(-) diff --git a/flytectl/cmd/compile/compile.go b/flytectl/cmd/compile/compile.go index ffbbbad90e..d64f079152 100644 --- a/flytectl/cmd/compile/compile.go +++ b/flytectl/cmd/compile/compile.go @@ -140,6 +140,7 @@ func CreateCompileCommand() map[string]cmdCore.CommandEntry { CmdFunc: compile, PFlagProvider: config.DefaultCompileConfig, ProjectDomainNotRequired: true, + DisableFlyteClient: true, }, } return compileResourcesFuncs diff --git a/flytectl/cmd/core/cmd.go b/flytectl/cmd/core/cmd.go index 3c37f28ab6..a6f7c391df 100644 --- a/flytectl/cmd/core/cmd.go +++ b/flytectl/cmd/core/cmd.go @@ -4,6 +4,10 @@ import ( "context" "fmt" + "github.com/pkg/errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/flyteorg/flytectl/cmd/config" "github.com/flyteorg/flytectl/pkg/pkce" "github.com/flyteorg/flyteidl/clients/go/admin" @@ -23,6 +27,7 @@ type CommandEntry struct { Short string Long string PFlagProvider PFlagProvider + DisableFlyteClient bool } func AddCommands(rootCmd *cobra.Command, cmdFuncs map[string]CommandEntry) { @@ -65,14 +70,29 @@ func generateCommandFunc(cmdEntry CommandEntry) func(cmd *cobra.Command, args [] return cmdEntry.CmdFunc(ctx, args, CommandContext{}) } - clientSet, err := admin.ClientSetBuilder().WithConfig(admin.GetConfig(ctx)). - WithTokenCache(pkce.TokenCacheKeyringProvider{ - ServiceUser: fmt.Sprintf("%s:%s", adminCfg.Endpoint.String(), pkce.KeyRingServiceUser), - ServiceName: pkce.KeyRingServiceName, - }).Build(ctx) + cmdCtx := NewCommandContextNoClient(cmd.OutOrStdout()) + if !cmdEntry.DisableFlyteClient { + clientSet, err := admin.ClientSetBuilder().WithConfig(admin.GetConfig(ctx)). + WithTokenCache(pkce.TokenCacheKeyringProvider{ + ServiceUser: fmt.Sprintf("%s:%s", adminCfg.Endpoint.String(), pkce.KeyRingServiceUser), + ServiceName: pkce.KeyRingServiceName, + }).Build(ctx) + if err != nil { + return err + } + cmdCtx = NewCommandContext(clientSet, cmd.OutOrStdout()) + } + + err := cmdEntry.CmdFunc(ctx, args, cmdCtx) if err != nil { + if s, ok := status.FromError(err); ok { + if s.Code() == codes.Unavailable || s.Code() == codes.Unauthenticated || s.Code() == codes.Unknown { + return errors.WithMessage(err, + fmt.Sprintf("Connection Info: [Endpoint: %s, InsecureConnection?: %v, AuthMode: %v]", adminCfg.Endpoint.String(), adminCfg.UseInsecureConnection, adminCfg.AuthType)) + } + } return err } - return cmdEntry.CmdFunc(ctx, args, NewCommandContext(clientSet, cmd.OutOrStdout())) + return nil } } diff --git a/flytectl/cmd/core/cmd_ctx.go b/flytectl/cmd/core/cmd_ctx.go index 7d02474490..f5cd095c4f 100644 --- a/flytectl/cmd/core/cmd_ctx.go +++ b/flytectl/cmd/core/cmd_ctx.go @@ -18,14 +18,23 @@ type CommandContext struct { out io.Writer } +// NewCommandContextNoClient returns a new commandContext +func NewCommandContextNoClient(out io.Writer) CommandContext { + return NewCommandContext(nil, out) +} + func NewCommandContext(clientSet *admin.Clientset, out io.Writer) CommandContext { - return CommandContext{ - clientSet: clientSet, - out: out, - adminClientFetcherExt: &ext.AdminFetcherExtClient{AdminClient: clientSet.AdminClient()}, - adminClientUpdateExt: &ext.AdminUpdaterExtClient{AdminClient: clientSet.AdminClient()}, - adminClientDeleteExt: &ext.AdminDeleterExtClient{AdminClient: clientSet.AdminClient()}, + var adminClient service.AdminServiceClient + if clientSet != nil { + adminClient = clientSet.AdminClient() } + return NewCommandContextWithExt( + clientSet, + &ext.AdminFetcherExtClient{AdminClient: adminClient}, + &ext.AdminUpdaterExtClient{AdminClient: adminClient}, + &ext.AdminDeleterExtClient{AdminClient: adminClient}, + out, + ) } // NewCommandContextWithExt construct command context with injected extensions. Helps in injecting mocked ones for testing. diff --git a/flytectl/cmd/create/execution.go b/flytectl/cmd/create/execution.go index dc1ba493c1..b3711c49a2 100644 --- a/flytectl/cmd/create/execution.go +++ b/flytectl/cmd/create/execution.go @@ -66,13 +66,13 @@ It is worth noting that the source's and target's project and domain can be diff flytectl create execution --execFile execution_spec.yaml -p flytesnacks -d staging --targetProject flytesnacks -To relaunch an execution, pass the current execution ID as follows: +4. To relaunch an execution, pass the current execution ID as follows: :: flytectl create execution --relaunch ffb31066a0f8b4d52b77 -p flytesnacks -d development -To recover an execution, i.e., recreate it from the last known failure point for previously-run workflow execution, run: +5. To recover an execution, i.e., recreate it from the last known failure point for previously-run workflow execution, run: :: @@ -80,7 +80,15 @@ To recover an execution, i.e., recreate it from the last known failure point for See :ref:` + "`ref_flyteidl.admin.ExecutionRecoverRequest`" + ` for more details. -Generic data types are supported for execution in a similar manner. +6. You can create executions idempotently by naming them. This is also a way to *name* an execution for discovery. Note, +an execution id has to be unique within a project domain. So if the *name* matches an existing execution an already exists exceptioj +will be raised. + +:: + + flytectl create execution --recover ffb31066a0f8b4d52b77 -p flytesnacks -d development custom_name + +7. Generic/Struct/Dataclass/JSON types are supported for execution in a similar manner. The following is an example of how generic data can be specified while creating the execution. :: @@ -100,7 +108,7 @@ The generated file would look similar to this. Here, empty values have been dump task: core.type_system.custom_objects.add version: v3 -Modified file with struct data populated for 'x' and 'y' parameters for the task "core.type_system.custom_objects.add": +8. Modified file with struct data populated for 'x' and 'y' parameters for the task "core.type_system.custom_objects.add": :: @@ -171,21 +179,27 @@ func createExecutionCommand(ctx context.Context, args []string, cmdCtx cmdCore.C var err error sourceProject := config.GetConfig().Project sourceDomain := config.GetConfig().Domain + + var targetExecName string + if len(args) > 0 { + targetExecName = args[0] + } + if execParams, err = readConfigAndValidate(config.GetConfig().Project, config.GetConfig().Domain); err != nil { return err } var executionRequest *admin.ExecutionCreateRequest switch execParams.execType { case Relaunch: - return relaunchExecution(ctx, execParams.name, sourceProject, sourceDomain, cmdCtx, executionConfig) + return relaunchExecution(ctx, execParams.name, sourceProject, sourceDomain, cmdCtx, executionConfig, targetExecName) case Recover: - return recoverExecution(ctx, execParams.name, sourceProject, sourceDomain, cmdCtx, executionConfig) + return recoverExecution(ctx, execParams.name, sourceProject, sourceDomain, cmdCtx, executionConfig, targetExecName) case Task: - if executionRequest, err = createExecutionRequestForTask(ctx, execParams.name, sourceProject, sourceDomain, cmdCtx, executionConfig); err != nil { + if executionRequest, err = createExecutionRequestForTask(ctx, execParams.name, sourceProject, sourceDomain, cmdCtx, executionConfig, targetExecName); err != nil { return err } case Workflow: - if executionRequest, err = createExecutionRequestForWorkflow(ctx, execParams.name, sourceProject, sourceDomain, cmdCtx, executionConfig); err != nil { + if executionRequest, err = createExecutionRequestForWorkflow(ctx, execParams.name, sourceProject, sourceDomain, cmdCtx, executionConfig, targetExecName); err != nil { return err } default: diff --git a/flytectl/cmd/create/execution_util.go b/flytectl/cmd/create/execution_util.go index ed862783d0..41c438f274 100644 --- a/flytectl/cmd/create/execution_util.go +++ b/flytectl/cmd/create/execution_util.go @@ -16,7 +16,7 @@ import ( ) func createExecutionRequestForWorkflow(ctx context.Context, workflowName, project, domain string, - cmdCtx cmdCore.CommandContext, executionConfig *ExecutionConfig) (*admin.ExecutionCreateRequest, error) { + cmdCtx cmdCore.CommandContext, executionConfig *ExecutionConfig, targetExecName string) (*admin.ExecutionCreateRequest, error) { // Fetch the launch plan lp, err := cmdCtx.AdminFetcherExt().FetchLPVersion(ctx, workflowName, executionConfig.Version, project, domain) if err != nil { @@ -51,11 +51,11 @@ func createExecutionRequestForWorkflow(ctx context.Context, workflowName, projec } } - return createExecutionRequest(lp.Id, inputs, securityContext, authRole), nil + return createExecutionRequest(lp.Id, inputs, securityContext, authRole, targetExecName), nil } func createExecutionRequestForTask(ctx context.Context, taskName string, project string, domain string, - cmdCtx cmdCore.CommandContext, executionConfig *ExecutionConfig) (*admin.ExecutionCreateRequest, error) { + cmdCtx cmdCore.CommandContext, executionConfig *ExecutionConfig, targetExecName string) (*admin.ExecutionCreateRequest, error) { // Fetch the task task, err := cmdCtx.AdminFetcherExt().FetchTaskVersion(ctx, taskName, executionConfig.Version, project, domain) if err != nil { @@ -97,11 +97,11 @@ func createExecutionRequestForTask(ctx context.Context, taskName string, project Version: task.Id.Version, } - return createExecutionRequest(id, inputs, securityContext, authRole), nil + return createExecutionRequest(id, inputs, securityContext, authRole, targetExecName), nil } func relaunchExecution(ctx context.Context, executionName string, project string, domain string, - cmdCtx cmdCore.CommandContext, executionConfig *ExecutionConfig) error { + cmdCtx cmdCore.CommandContext, executionConfig *ExecutionConfig, targetExecutionName string) error { if executionConfig.DryRun { logger.Debugf(ctx, "skipping RelaunchExecution request (DryRun)") return nil @@ -112,6 +112,7 @@ func relaunchExecution(ctx context.Context, executionName string, project string Project: project, Domain: domain, }, + Name: targetExecutionName, }) if err != nil { return err @@ -121,7 +122,7 @@ func relaunchExecution(ctx context.Context, executionName string, project string } func recoverExecution(ctx context.Context, executionName string, project string, domain string, - cmdCtx cmdCore.CommandContext, executionConfig *ExecutionConfig) error { + cmdCtx cmdCore.CommandContext, executionConfig *ExecutionConfig, targetExecName string) error { if executionConfig.DryRun { logger.Debugf(ctx, "skipping RecoverExecution request (DryRun)") return nil @@ -132,6 +133,7 @@ func recoverExecution(ctx context.Context, executionName string, project string, Project: project, Domain: domain, }, + Name: targetExecName, }) if err != nil { return err @@ -141,12 +143,15 @@ func recoverExecution(ctx context.Context, executionName string, project string, } func createExecutionRequest(ID *core.Identifier, inputs *core.LiteralMap, securityContext *core.SecurityContext, - authRole *admin.AuthRole) *admin.ExecutionCreateRequest { + authRole *admin.AuthRole, targetExecName string) *admin.ExecutionCreateRequest { + if len(targetExecName) == 0 { + targetExecName = "f" + strings.ReplaceAll(uuid.New().String(), "-", "")[:19] + } return &admin.ExecutionCreateRequest{ Project: executionConfig.TargetProject, Domain: executionConfig.TargetDomain, - Name: "f" + strings.ReplaceAll(uuid.New().String(), "-", "")[:19], + Name: targetExecName, Spec: &admin.ExecutionSpec{ LaunchPlan: ID, Metadata: &admin.ExecutionMetadata{ diff --git a/flytectl/cmd/create/execution_util_test.go b/flytectl/cmd/create/execution_util_test.go index 0342d4b5c7..e36b957890 100644 --- a/flytectl/cmd/create/execution_util_test.go +++ b/flytectl/cmd/create/execution_util_test.go @@ -49,7 +49,7 @@ func TestCreateExecutionForRelaunch(t *testing.T) { s := setup() createExecutionUtilSetup() s.MockAdminClient.OnRelaunchExecutionMatch(s.Ctx, relaunchRequest).Return(executionCreateResponse, nil) - err := relaunchExecution(s.Ctx, "execName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + err := relaunchExecution(s.Ctx, "execName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.Nil(t, err) } @@ -57,7 +57,7 @@ func TestCreateExecutionForRelaunchNotFound(t *testing.T) { s := setup() createExecutionUtilSetup() s.MockAdminClient.OnRelaunchExecutionMatch(s.Ctx, relaunchRequest).Return(nil, errors.New("unknown execution")) - err := relaunchExecution(s.Ctx, "execName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + err := relaunchExecution(s.Ctx, "execName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.NotNil(t, err) assert.Equal(t, err, errors.New("unknown execution")) @@ -67,7 +67,7 @@ func TestCreateExecutionForRecovery(t *testing.T) { s := setup() createExecutionUtilSetup() s.MockAdminClient.OnRecoverExecutionMatch(s.Ctx, recoverRequest).Return(executionCreateResponse, nil) - err := recoverExecution(s.Ctx, "execName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + err := recoverExecution(s.Ctx, "execName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.Nil(t, err) } @@ -75,7 +75,7 @@ func TestCreateExecutionForRecoveryNotFound(t *testing.T) { s := setup() createExecutionUtilSetup() s.MockAdminClient.OnRecoverExecutionMatch(s.Ctx, recoverRequest).Return(nil, errors.New("unknown execution")) - err := recoverExecution(s.Ctx, "execName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + err := recoverExecution(s.Ctx, "execName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.NotNil(t, err) assert.Equal(t, err, errors.New("unknown execution")) } @@ -86,7 +86,7 @@ func TestCreateExecutionRequestForWorkflow(t *testing.T) { createExecutionUtilSetup() launchPlan := &admin.LaunchPlan{} s.FetcherExt.OnFetchLPVersionMatch(s.Ctx, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(launchPlan, nil) - execCreateRequest, err := createExecutionRequestForWorkflow(s.Ctx, "wfName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + execCreateRequest, err := createExecutionRequestForWorkflow(s.Ctx, "wfName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.Nil(t, err) assert.NotNil(t, execCreateRequest) }) @@ -101,7 +101,7 @@ func TestCreateExecutionRequestForWorkflow(t *testing.T) { }, } s.FetcherExt.OnFetchLPVersionMatch(s.Ctx, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(launchPlan, nil) - execCreateRequest, err := createExecutionRequestForWorkflow(s.Ctx, "wfName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + execCreateRequest, err := createExecutionRequestForWorkflow(s.Ctx, "wfName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.NotNil(t, err) assert.Nil(t, execCreateRequest) assert.Equal(t, fmt.Errorf("parameter [nilparam] has nil Variable"), err) @@ -110,7 +110,7 @@ func TestCreateExecutionRequestForWorkflow(t *testing.T) { s := setup() createExecutionUtilSetup() s.FetcherExt.OnFetchLPVersionMatch(s.Ctx, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed")) - execCreateRequest, err := createExecutionRequestForWorkflow(s.Ctx, "wfName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + execCreateRequest, err := createExecutionRequestForWorkflow(s.Ctx, "wfName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.NotNil(t, err) assert.Nil(t, execCreateRequest) assert.Equal(t, err, errors.New("failed")) @@ -122,7 +122,7 @@ func TestCreateExecutionRequestForWorkflow(t *testing.T) { launchPlan := &admin.LaunchPlan{} s.FetcherExt.OnFetchLPVersionMatch(s.Ctx, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(launchPlan, nil) s.MockAdminClient.OnGetLaunchPlanMatch(s.Ctx, mock.Anything).Return(launchPlan, nil) - execCreateRequest, err := createExecutionRequestForWorkflow(s.Ctx, "wfName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + execCreateRequest, err := createExecutionRequestForWorkflow(s.Ctx, "wfName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.Nil(t, err) assert.NotNil(t, execCreateRequest) executionConfig.KubeServiceAcct = "" @@ -139,7 +139,7 @@ func TestCreateExecutionRequestForTask(t *testing.T) { }, } s.FetcherExt.OnFetchTaskVersionMatch(s.Ctx, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(task, nil) - execCreateRequest, err := createExecutionRequestForTask(s.Ctx, "taskName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + execCreateRequest, err := createExecutionRequestForTask(s.Ctx, "taskName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.Nil(t, err) assert.NotNil(t, execCreateRequest) }) @@ -162,7 +162,7 @@ func TestCreateExecutionRequestForTask(t *testing.T) { }, } s.FetcherExt.OnFetchTaskVersionMatch(s.Ctx, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(task, nil) - execCreateRequest, err := createExecutionRequestForTask(s.Ctx, "taskName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + execCreateRequest, err := createExecutionRequestForTask(s.Ctx, "taskName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.NotNil(t, err) assert.Nil(t, execCreateRequest) assert.Equal(t, fmt.Errorf("variable [nilvar] has nil type"), err) @@ -171,7 +171,7 @@ func TestCreateExecutionRequestForTask(t *testing.T) { s := setup() createExecutionUtilSetup() s.FetcherExt.OnFetchTaskVersionMatch(s.Ctx, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed")) - execCreateRequest, err := createExecutionRequestForTask(s.Ctx, "taskName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + execCreateRequest, err := createExecutionRequestForTask(s.Ctx, "taskName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.NotNil(t, err) assert.Nil(t, execCreateRequest) assert.Equal(t, err, errors.New("failed")) @@ -186,7 +186,7 @@ func TestCreateExecutionRequestForTask(t *testing.T) { }, } s.FetcherExt.OnFetchTaskVersionMatch(s.Ctx, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(task, nil) - execCreateRequest, err := createExecutionRequestForTask(s.Ctx, "taskName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig) + execCreateRequest, err := createExecutionRequestForTask(s.Ctx, "taskName", config.GetConfig().Project, config.GetConfig().Domain, s.CmdCtx, executionConfig, "") assert.Nil(t, err) assert.NotNil(t, execCreateRequest) executionConfig.KubeServiceAcct = "" diff --git a/flytectl/cmd/demo/demo.go b/flytectl/cmd/demo/demo.go index 30b29c8040..35149b6823 100644 --- a/flytectl/cmd/demo/demo.go +++ b/flytectl/cmd/demo/demo.go @@ -46,16 +46,16 @@ func CreateDemoCommand() *cobra.Command { demoResourcesFuncs := map[string]cmdcore.CommandEntry{ "start": {CmdFunc: startDemoCluster, Aliases: []string{}, ProjectDomainNotRequired: true, Short: startShort, - Long: startLong, PFlagProvider: sandboxCmdConfig.DefaultConfig}, + Long: startLong, PFlagProvider: sandboxCmdConfig.DefaultConfig, DisableFlyteClient: true}, "teardown": {CmdFunc: teardownDemoCluster, Aliases: []string{}, ProjectDomainNotRequired: true, Short: teardownShort, - Long: teardownLong}, + Long: teardownLong, DisableFlyteClient: true}, "status": {CmdFunc: demoClusterStatus, Aliases: []string{}, ProjectDomainNotRequired: true, Short: statusShort, Long: statusLong}, "exec": {CmdFunc: demoClusterExec, Aliases: []string{}, ProjectDomainNotRequired: true, Short: execShort, - Long: execLong}, + Long: execLong, DisableFlyteClient: true}, } cmdcore.AddCommands(demo, demoResourcesFuncs) diff --git a/flytectl/cmd/sandbox/sandbox.go b/flytectl/cmd/sandbox/sandbox.go index 2dc5ab95a4..2e342c41e4 100644 --- a/flytectl/cmd/sandbox/sandbox.go +++ b/flytectl/cmd/sandbox/sandbox.go @@ -46,16 +46,16 @@ func CreateSandboxCommand() *cobra.Command { sandboxResourcesFuncs := map[string]cmdcore.CommandEntry{ "start": {CmdFunc: startSandboxCluster, Aliases: []string{}, ProjectDomainNotRequired: true, Short: startShort, - Long: startLong, PFlagProvider: sandboxCmdConfig.DefaultConfig}, + Long: startLong, PFlagProvider: sandboxCmdConfig.DefaultConfig, DisableFlyteClient: true}, "teardown": {CmdFunc: teardownSandboxCluster, Aliases: []string{}, ProjectDomainNotRequired: true, Short: teardownShort, - Long: teardownLong}, + Long: teardownLong, DisableFlyteClient: true}, "status": {CmdFunc: sandboxClusterStatus, Aliases: []string{}, ProjectDomainNotRequired: true, Short: statusShort, Long: statusLong}, "exec": {CmdFunc: sandboxClusterExec, Aliases: []string{}, ProjectDomainNotRequired: true, Short: execShort, - Long: execLong}, + Long: execLong, DisableFlyteClient: true}, } cmdcore.AddCommands(sandbox, sandboxResourcesFuncs) diff --git a/flytectl/cmd/upgrade/upgrade.go b/flytectl/cmd/upgrade/upgrade.go index f8c4099e4e..b760975a5a 100644 --- a/flytectl/cmd/upgrade/upgrade.go +++ b/flytectl/cmd/upgrade/upgrade.go @@ -54,9 +54,14 @@ var ( // SelfUpgrade will return self upgrade command func SelfUpgrade(rootCmd *cobra.Command) map[string]cmdCore.CommandEntry { getResourcesFuncs := map[string]cmdCore.CommandEntry{ - "upgrade": {CmdFunc: selfUpgrade, Aliases: []string{"upgrade"}, ProjectDomainNotRequired: true, - Short: upgradeCmdShort, - Long: upgradeCmdLong}, + "upgrade": { + CmdFunc: selfUpgrade, + Aliases: []string{"upgrade"}, + ProjectDomainNotRequired: true, + Short: upgradeCmdShort, + Long: upgradeCmdLong, + DisableFlyteClient: true, + }, } return getResourcesFuncs }