diff --git a/flytectl/clierrors/errors.go b/flytectl/clierrors/errors.go index f6869aa2b29..0085d1711cb 100644 --- a/flytectl/clierrors/errors.go +++ b/flytectl/clierrors/errors.go @@ -6,8 +6,9 @@ var ( ErrProjectNotPassed = "Project not passed\n" ErrFailedProjectUpdate = "Project %v failed to get updated to %v state due to %v\n" - ErrLPNotPassed = "Launch plan name not passed\n" - ErrFailedLPUpdate = "Launch plan %v failed to get updated due to %v\n" + ErrLPNotPassed = "Launch plan name not passed\n" + ErrLPVersionNotPassed = "Launch plan version not passed\n" //nolint + ErrFailedLPUpdate = "Launch plan %v failed to get updated due to %v\n" ErrWorkflowNotPassed = "Workflow name not passed\n" ErrFailedWorkflowUpdate = "Workflow %v failed to get updated to due to %v\n" diff --git a/flytectl/cmd/config/subcommand/launchplan/updateconfig.go b/flytectl/cmd/config/subcommand/launchplan/updateconfig.go new file mode 100644 index 00000000000..9fcbb8869d1 --- /dev/null +++ b/flytectl/cmd/config/subcommand/launchplan/updateconfig.go @@ -0,0 +1,14 @@ +package launchplan + +//go:generate pflags UpdateConfig --default-var UConfig --bind-default-var +var ( + UConfig = &UpdateConfig{} +) + +// Config +type UpdateConfig struct { + Archive bool `json:"archive" pflag:",archive launchplan."` + Activate bool `json:"activate" pflag:",activate launchplan."` + DryRun bool `json:"dryRun" pflag:",execute command without making any modifications."` + Version string `json:"version" pflag:",version of the launchplan to be fetched."` +} diff --git a/flytectl/cmd/config/subcommand/launchplan/updateconfig_flags.go b/flytectl/cmd/config/subcommand/launchplan/updateconfig_flags.go new file mode 100755 index 00000000000..b217372c76b --- /dev/null +++ b/flytectl/cmd/config/subcommand/launchplan/updateconfig_flags.go @@ -0,0 +1,58 @@ +// Code generated by go generate; DO NOT EDIT. +// This file was generated by robots. + +package launchplan + +import ( + "encoding/json" + "reflect" + + "fmt" + + "github.com/spf13/pflag" +) + +// If v is a pointer, it will get its element value or the zero value of the element type. +// If v is not a pointer, it will return it as is. +func (UpdateConfig) elemValueOrNil(v interface{}) interface{} { + if t := reflect.TypeOf(v); t.Kind() == reflect.Ptr { + if reflect.ValueOf(v).IsNil() { + return reflect.Zero(t.Elem()).Interface() + } else { + return reflect.ValueOf(v).Interface() + } + } else if v == nil { + return reflect.Zero(t).Interface() + } + + return v +} + +func (UpdateConfig) mustJsonMarshal(v interface{}) string { + raw, err := json.Marshal(v) + if err != nil { + panic(err) + } + + return string(raw) +} + +func (UpdateConfig) mustMarshalJSON(v json.Marshaler) string { + raw, err := v.MarshalJSON() + if err != nil { + panic(err) + } + + return string(raw) +} + +// GetPFlagSet will return strongly types pflags for all fields in UpdateConfig and its nested types. The format of the +// flags is json-name.json-sub-name... etc. +func (cfg UpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { + cmdFlags := pflag.NewFlagSet("UpdateConfig", pflag.ExitOnError) + cmdFlags.BoolVar(&UConfig.Archive, fmt.Sprintf("%v%v", prefix, "archive"), UConfig.Archive, "archive launchplan.") + cmdFlags.BoolVar(&UConfig.Activate, fmt.Sprintf("%v%v", prefix, "activate"), UConfig.Activate, "activate launchplan.") + cmdFlags.BoolVar(&UConfig.DryRun, fmt.Sprintf("%v%v", prefix, "dryRun"), UConfig.DryRun, "execute command without making any modifications.") + cmdFlags.StringVar(&UConfig.Version, fmt.Sprintf("%v%v", prefix, "version"), UConfig.Version, "version of the launchplan to be fetched.") + return cmdFlags +} diff --git a/flytectl/cmd/config/subcommand/launchplan/updateconfig_flags_test.go b/flytectl/cmd/config/subcommand/launchplan/updateconfig_flags_test.go new file mode 100755 index 00000000000..a0d1c1adf6c --- /dev/null +++ b/flytectl/cmd/config/subcommand/launchplan/updateconfig_flags_test.go @@ -0,0 +1,158 @@ +// Code generated by go generate; DO NOT EDIT. +// This file was generated by robots. + +package launchplan + +import ( + "encoding/json" + "fmt" + "reflect" + "strings" + "testing" + + "github.com/mitchellh/mapstructure" + "github.com/stretchr/testify/assert" +) + +var dereferencableKindsUpdateConfig = map[reflect.Kind]struct{}{ + reflect.Array: {}, reflect.Chan: {}, reflect.Map: {}, reflect.Ptr: {}, reflect.Slice: {}, +} + +// Checks if t is a kind that can be dereferenced to get its underlying type. +func canGetElementUpdateConfig(t reflect.Kind) bool { + _, exists := dereferencableKindsUpdateConfig[t] + return exists +} + +// This decoder hook tests types for json unmarshaling capability. If implemented, it uses json unmarshal to build the +// object. Otherwise, it'll just pass on the original data. +func jsonUnmarshalerHookUpdateConfig(_, to reflect.Type, data interface{}) (interface{}, error) { + unmarshalerType := reflect.TypeOf((*json.Unmarshaler)(nil)).Elem() + if to.Implements(unmarshalerType) || reflect.PtrTo(to).Implements(unmarshalerType) || + (canGetElementUpdateConfig(to.Kind()) && to.Elem().Implements(unmarshalerType)) { + + raw, err := json.Marshal(data) + if err != nil { + fmt.Printf("Failed to marshal Data: %v. Error: %v. Skipping jsonUnmarshalHook", data, err) + return data, nil + } + + res := reflect.New(to).Interface() + err = json.Unmarshal(raw, &res) + if err != nil { + fmt.Printf("Failed to umarshal Data: %v. Error: %v. Skipping jsonUnmarshalHook", data, err) + return data, nil + } + + return res, nil + } + + return data, nil +} + +func decode_UpdateConfig(input, result interface{}) error { + config := &mapstructure.DecoderConfig{ + TagName: "json", + WeaklyTypedInput: true, + Result: result, + DecodeHook: mapstructure.ComposeDecodeHookFunc( + mapstructure.StringToTimeDurationHookFunc(), + mapstructure.StringToSliceHookFunc(","), + jsonUnmarshalerHookUpdateConfig, + ), + } + + decoder, err := mapstructure.NewDecoder(config) + if err != nil { + return err + } + + return decoder.Decode(input) +} + +func join_UpdateConfig(arr interface{}, sep string) string { + listValue := reflect.ValueOf(arr) + strs := make([]string, 0, listValue.Len()) + for i := 0; i < listValue.Len(); i++ { + strs = append(strs, fmt.Sprintf("%v", listValue.Index(i))) + } + + return strings.Join(strs, sep) +} + +func testDecodeJson_UpdateConfig(t *testing.T, val, result interface{}) { + assert.NoError(t, decode_UpdateConfig(val, result)) +} + +func testDecodeRaw_UpdateConfig(t *testing.T, vStringSlice, result interface{}) { + assert.NoError(t, decode_UpdateConfig(vStringSlice, result)) +} + +func TestUpdateConfig_GetPFlagSet(t *testing.T) { + val := UpdateConfig{} + cmdFlags := val.GetPFlagSet("") + assert.True(t, cmdFlags.HasFlags()) +} + +func TestUpdateConfig_SetFlags(t *testing.T) { + actual := UpdateConfig{} + cmdFlags := actual.GetPFlagSet("") + assert.True(t, cmdFlags.HasFlags()) + + t.Run("Test_archive", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("archive", testValue) + if vBool, err := cmdFlags.GetBool("archive"); err == nil { + testDecodeJson_UpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Archive) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) + t.Run("Test_activate", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("activate", testValue) + if vBool, err := cmdFlags.GetBool("activate"); err == nil { + testDecodeJson_UpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.Activate) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) + t.Run("Test_dryRun", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("dryRun", testValue) + if vBool, err := cmdFlags.GetBool("dryRun"); err == nil { + testDecodeJson_UpdateConfig(t, fmt.Sprintf("%v", vBool), &actual.DryRun) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) + t.Run("Test_version", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("version", testValue) + if vString, err := cmdFlags.GetString("version"); err == nil { + testDecodeJson_UpdateConfig(t, fmt.Sprintf("%v", vString), &actual.Version) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) +} diff --git a/flytectl/cmd/get/execution.go b/flytectl/cmd/get/execution.go index e17d6759d72..45ce3d9b69b 100644 --- a/flytectl/cmd/get/execution.go +++ b/flytectl/cmd/get/execution.go @@ -88,6 +88,7 @@ var executionColumns = []printer.Column{ {Header: "Launch Plan Name", JSONPath: "$.spec.launchPlan.name"}, {Header: "Type", JSONPath: "$.spec.launchPlan.resourceType"}, {Header: "Phase", JSONPath: "$.closure.phase"}, + {Header: "Scheduled Time", JSONPath: "$.spec.metadata.scheduledAt"}, {Header: "Started", JSONPath: "$.closure.startedAt"}, {Header: "Elapsed Time", JSONPath: "$.closure.duration"}, {Header: "Abort data (Trunc)", JSONPath: "$.closure.abortMetadata[\"cause\"]", TruncateTo: &hundredChars}, diff --git a/flytectl/cmd/update/launch_plan.go b/flytectl/cmd/update/launch_plan.go index 1f32a2cb04d..a9dd059c5c9 100644 --- a/flytectl/cmd/update/launch_plan.go +++ b/flytectl/cmd/update/launch_plan.go @@ -6,27 +6,26 @@ import ( "github.com/flyteorg/flytectl/clierrors" "github.com/flyteorg/flytectl/cmd/config" + "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" cmdCore "github.com/flyteorg/flytectl/cmd/core" + "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flytestdlib/logger" ) const ( - updateLPShort = "Updates launch plan metadata" + updateLPShort = "Updates launch plan status" updateLPLong = ` -Following command updates the description on the launchplan. +Activating launchplan activates the scheduled job associated with it :: - flytectl update launchplan -p flytectldemo -d development core.advanced.run_merge_sort.merge_sort --description "Mergesort example" + flytectl update launchplan -p flytectldemo -d development core.advanced.run_merge_sort.merge_sort --version v1 --activate -Archiving launchplan named entity is not supported and would throw an error. +Archiving launchplan deschedules any scheduled job associated with it :: - flytectl update launchplan -p flytectldemo -d development core.advanced.run_merge_sort.merge_sort --archive + flytectl update launchplan -p flytectldemo -d development core.advanced.run_merge_sort.merge_sort --version v1 --archive -Activating launchplan named entity would be a noop. -:: - - flytectl update launchplan -p flytectldemo -d development core.advanced.run_merge_sort.merge_sort --activate Usage ` @@ -39,11 +38,41 @@ func updateLPFunc(ctx context.Context, args []string, cmdCtx cmdCore.CommandCont return fmt.Errorf(clierrors.ErrLPNotPassed) } name := args[0] - err := namedEntityConfig.UpdateNamedEntity(ctx, name, project, domain, core.ResourceType_LAUNCH_PLAN, cmdCtx) - if err != nil { - fmt.Printf(clierrors.ErrFailedLPUpdate, name, err) - return err + version := launchplan.UConfig.Version + if len(version) == 0 { + return fmt.Errorf(clierrors.ErrLPVersionNotPassed) + } + activateLP := launchplan.UConfig.Activate + archiveLP := launchplan.UConfig.Archive + if activateLP == archiveLP && archiveLP { + return fmt.Errorf(clierrors.ErrInvalidStateUpdate) + } + + var lpState admin.LaunchPlanState + if activateLP { + lpState = admin.LaunchPlanState_ACTIVE + } else if archiveLP { + lpState = admin.LaunchPlanState_INACTIVE + } + + if launchplan.UConfig.DryRun { + logger.Debugf(ctx, "skipping CreateExecution request (DryRun)") + } else { + _, err := cmdCtx.AdminClient().UpdateLaunchPlan(ctx, &admin.LaunchPlanUpdateRequest{ + Id: &core.Identifier{ + Project: project, + Domain: domain, + Name: name, + Version: version, + }, + State: lpState, + }) + if err != nil { + fmt.Printf(clierrors.ErrFailedLPUpdate, name, err) + return err + } } - fmt.Printf("updated metadata successfully on %v", name) + fmt.Printf("updated launchplan successfully on %v", name) + return nil } diff --git a/flytectl/cmd/update/launch_plan_meta.go b/flytectl/cmd/update/launch_plan_meta.go new file mode 100644 index 00000000000..00cd9bef36e --- /dev/null +++ b/flytectl/cmd/update/launch_plan_meta.go @@ -0,0 +1,49 @@ +package update + +import ( + "context" + "fmt" + + "github.com/flyteorg/flytectl/clierrors" + "github.com/flyteorg/flytectl/cmd/config" + cmdCore "github.com/flyteorg/flytectl/cmd/core" + "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" +) + +const ( + updateLPMetaShort = "Updates launch plan metadata" + updateLPMetaLong = ` +Following command updates the description on the launchplan. +:: + + flytectl update launchplan -p flytectldemo -d development core.advanced.run_merge_sort.merge_sort --description "Mergesort example" + +Archiving launchplan named entity is not supported and would throw an error. +:: + + flytectl update launchplan -p flytectldemo -d development core.advanced.run_merge_sort.merge_sort --archive + +Activating launchplan named entity would be a noop. +:: + + flytectl update launchplan -p flytectldemo -d development core.advanced.run_merge_sort.merge_sort --activate + +Usage +` +) + +func updateLPMetaFunc(ctx context.Context, args []string, cmdCtx cmdCore.CommandContext) error { + project := config.GetConfig().Project + domain := config.GetConfig().Domain + if len(args) != 1 { + return fmt.Errorf(clierrors.ErrLPNotPassed) + } + name := args[0] + err := namedEntityConfig.UpdateNamedEntity(ctx, name, project, domain, core.ResourceType_LAUNCH_PLAN, cmdCtx) + if err != nil { + fmt.Printf(clierrors.ErrFailedLPUpdate, name, err) + return err + } + fmt.Printf("updated metadata successfully on %v", name) + return nil +} diff --git a/flytectl/cmd/update/launch_plan_meta_test.go b/flytectl/cmd/update/launch_plan_meta_test.go new file mode 100644 index 00000000000..0427964fc69 --- /dev/null +++ b/flytectl/cmd/update/launch_plan_meta_test.go @@ -0,0 +1,44 @@ +package update + +import ( + "fmt" + "testing" + + "github.com/flyteorg/flytectl/cmd/testutils" + "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +func UpdateLPMetaSetup() { + ctx = testutils.Ctx + cmdCtx = testutils.CmdCtx + mockClient = testutils.MockClient +} + +func TestLPMetaUpdate(t *testing.T) { + testutils.Setup() + UpdateLPMetaSetup() + namedEntityConfig = &NamedEntityConfig{} + args = []string{"task1"} + mockClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(&admin.NamedEntityUpdateResponse{}, nil) + assert.Nil(t, updateLPMetaFunc(ctx, args, cmdCtx)) +} + +func TestLPMetaUpdateFail(t *testing.T) { + testutils.Setup() + UpdateLPMetaSetup() + namedEntityConfig = &NamedEntityConfig{} + args = []string{"task1"} + mockClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed to update")) + assert.NotNil(t, updateTaskFunc(ctx, args, cmdCtx)) +} + +func TestLPMetaUpdateInvalidArgs(t *testing.T) { + testutils.Setup() + UpdateLPMetaSetup() + namedEntityConfig = &NamedEntityConfig{} + args = []string{} + assert.NotNil(t, updateTaskFunc(ctx, args, cmdCtx)) +} diff --git a/flytectl/cmd/update/launch_plan_test.go b/flytectl/cmd/update/launch_plan_test.go index aa8f8601de1..3ef074277b0 100644 --- a/flytectl/cmd/update/launch_plan_test.go +++ b/flytectl/cmd/update/launch_plan_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" "github.com/flyteorg/flytectl/cmd/testutils" "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" @@ -20,25 +21,25 @@ func UpdateLPSetup() { func TestLPUpdate(t *testing.T) { testutils.Setup() UpdateLPSetup() - namedEntityConfig = &NamedEntityConfig{} - args = []string{"task1"} - mockClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(&admin.NamedEntityUpdateResponse{}, nil) + launchplan.UConfig = &launchplan.UpdateConfig{Version: "v1", Archive: true} + args = []string{"lp1"} + mockClient.OnUpdateLaunchPlanMatch(mock.Anything, mock.Anything).Return(&admin.LaunchPlanUpdateResponse{}, nil) assert.Nil(t, updateLPFunc(ctx, args, cmdCtx)) } func TestLPUpdateFail(t *testing.T) { testutils.Setup() UpdateLPSetup() - namedEntityConfig = &NamedEntityConfig{} + launchplan.UConfig = &launchplan.UpdateConfig{Version: "v1", Archive: true} args = []string{"task1"} - mockClient.OnUpdateNamedEntityMatch(mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed to update")) - assert.NotNil(t, updateTaskFunc(ctx, args, cmdCtx)) + mockClient.OnUpdateLaunchPlanMatch(mock.Anything, mock.Anything).Return(nil, fmt.Errorf("failed to update")) + assert.NotNil(t, updateLPFunc(ctx, args, cmdCtx)) } func TestLPUpdateInvalidArgs(t *testing.T) { testutils.Setup() UpdateLPSetup() - namedEntityConfig = &NamedEntityConfig{} + launchplan.UConfig = &launchplan.UpdateConfig{Version: "v1", Archive: true, Activate: true} args = []string{} - assert.NotNil(t, updateTaskFunc(ctx, args, cmdCtx)) + assert.NotNil(t, updateLPFunc(ctx, args, cmdCtx)) } diff --git a/flytectl/cmd/update/task.go b/flytectl/cmd/update/task_meta.go similarity index 100% rename from flytectl/cmd/update/task.go rename to flytectl/cmd/update/task_meta.go diff --git a/flytectl/cmd/update/task_test.go b/flytectl/cmd/update/task_meta_test.go similarity index 100% rename from flytectl/cmd/update/task_test.go rename to flytectl/cmd/update/task_meta_test.go diff --git a/flytectl/cmd/update/update.go b/flytectl/cmd/update/update.go index efd2f0a48d9..c1a721b7047 100644 --- a/flytectl/cmd/update/update.go +++ b/flytectl/cmd/update/update.go @@ -4,6 +4,7 @@ import ( "github.com/flyteorg/flytectl/cmd/config/subcommand/clusterresourceattribute" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionclusterlabel" "github.com/flyteorg/flytectl/cmd/config/subcommand/executionqueueattribute" + "github.com/flyteorg/flytectl/cmd/config/subcommand/launchplan" pluginoverride "github.com/flyteorg/flytectl/cmd/config/subcommand/plugin_override" "github.com/flyteorg/flytectl/cmd/config/subcommand/taskresourceattribute" "github.com/flyteorg/flytectl/cmd/config/subcommand/workflowexecutionconfig" @@ -34,13 +35,15 @@ func CreateUpdateCommand() *cobra.Command { Long: updatecmdLong, } updateResourcesFuncs := map[string]cmdCore.CommandEntry{ - "launchplan": {CmdFunc: updateLPFunc, Aliases: []string{}, ProjectDomainNotRequired: false, PFlagProvider: namedEntityConfig, + "launchplan": {CmdFunc: updateLPFunc, Aliases: []string{}, ProjectDomainNotRequired: false, PFlagProvider: launchplan.UConfig, Short: updateLPShort, Long: updateLPLong}, + "launchplan-meta": {CmdFunc: updateLPMetaFunc, Aliases: []string{}, ProjectDomainNotRequired: false, PFlagProvider: namedEntityConfig, + Short: updateLPMetaShort, Long: updateLPMetaLong}, "project": {CmdFunc: updateProjectsFunc, Aliases: []string{}, ProjectDomainNotRequired: true, PFlagProvider: DefaultProjectConfig, Short: projectShort, Long: projectLong}, - "task": {CmdFunc: updateTaskFunc, Aliases: []string{}, ProjectDomainNotRequired: false, PFlagProvider: namedEntityConfig, + "task-meta": {CmdFunc: updateTaskFunc, Aliases: []string{}, ProjectDomainNotRequired: false, PFlagProvider: namedEntityConfig, Short: updateTaskShort, Long: updateTaskLong}, - "workflow": {CmdFunc: updateWorkflowFunc, Aliases: []string{}, ProjectDomainNotRequired: false, PFlagProvider: namedEntityConfig, + "workflow-meta": {CmdFunc: updateWorkflowFunc, Aliases: []string{}, ProjectDomainNotRequired: false, PFlagProvider: namedEntityConfig, Short: updateWorkflowShort, Long: updateWorkflowLong}, "task-resource-attribute": {CmdFunc: updateTaskResourceAttributesFunc, Aliases: []string{}, PFlagProvider: taskresourceattribute.DefaultUpdateConfig, Short: taskResourceAttributesShort, Long: taskResourceAttributesLong, ProjectDomainNotRequired: true}, diff --git a/flytectl/cmd/update/update_test.go b/flytectl/cmd/update/update_test.go index eecfbff0d66..8cf80f3f73b 100644 --- a/flytectl/cmd/update/update_test.go +++ b/flytectl/cmd/update/update_test.go @@ -32,19 +32,19 @@ func TestUpdateCommand(t *testing.T) { assert.Equal(t, updateCommand.Use, updateUse) assert.Equal(t, updateCommand.Short, updateShort) assert.Equal(t, updateCommand.Long, updatecmdLong) - assert.Equal(t, len(updateCommand.Commands()), 10) + assert.Equal(t, len(updateCommand.Commands()), 11) cmdNouns := updateCommand.Commands() // Sort by Use value. sort.Slice(cmdNouns, func(i, j int) bool { return cmdNouns[i].Use < cmdNouns[j].Use }) useArray := []string{"cluster-resource-attribute", "execution-cluster-label", "execution-queue-attribute", "launchplan", - "plugin-override", "project", "task", "task-resource-attribute", "workflow", "workflow-execution-config"} - aliases := [][]string{{}, {}, {}, {}, {}, {}, {}, {}, {}, {}} - shortArray := []string{clusterResourceAttributesShort, executionClusterLabelShort, executionQueueAttributesShort, updateLPShort, - pluginOverrideShort, projectShort, updateTaskShort, taskResourceAttributesShort, updateWorkflowShort, workflowExecutionConfigShort} - longArray := []string{clusterResourceAttributesLong, executionClusterLabelLong, executionQueueAttributesLong, updateLPLong, - pluginOverrideLong, projectLong, updateTaskLong, taskResourceAttributesLong, updateWorkflowLong, workflowExecutionConfigLong} + "launchplan-meta", "plugin-override", "project", "task-meta", "task-resource-attribute", "workflow-execution-config", "workflow-meta"} + aliases := [][]string{{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}} + shortArray := []string{clusterResourceAttributesShort, executionClusterLabelShort, executionQueueAttributesShort, updateLPShort, updateLPMetaShort, + pluginOverrideShort, projectShort, updateTaskShort, taskResourceAttributesShort, workflowExecutionConfigShort, updateWorkflowShort} + longArray := []string{clusterResourceAttributesLong, executionClusterLabelLong, executionQueueAttributesLong, updateLPLong, updateLPMetaLong, + pluginOverrideLong, projectLong, updateTaskLong, taskResourceAttributesLong, workflowExecutionConfigLong, updateWorkflowLong} for i := range cmdNouns { assert.Equal(t, cmdNouns[i].Use, useArray[i]) assert.Equal(t, cmdNouns[i].Aliases, aliases[i]) diff --git a/flytectl/cmd/update/workflow.go b/flytectl/cmd/update/workflow_meta.go similarity index 100% rename from flytectl/cmd/update/workflow.go rename to flytectl/cmd/update/workflow_meta.go diff --git a/flytectl/cmd/update/workflow_test.go b/flytectl/cmd/update/workflow_meta_test.go similarity index 100% rename from flytectl/cmd/update/workflow_test.go rename to flytectl/cmd/update/workflow_meta_test.go