diff --git a/clierrors/errors.go b/clierrors/errors.go index 5f5d58c6..a93f3c7a 100644 --- a/clierrors/errors.go +++ b/clierrors/errors.go @@ -1,7 +1,7 @@ package clierrors var ( - ErrInvalidUpdate = "Invalid state passed. Specify either activate or archive\n" + ErrInvalidStateUpdate = "Invalid state passed. Specify either activate or archive\n" ErrProjectNotPassed = "Project not passed\n" ErrFailedProjectUpdate = "Project %v failed to get updated to %v state due to %v\n" diff --git a/cmd/update/interfaces/updater.go b/cmd/update/interfaces/updater.go index bf372de8..3ea18f67 100644 --- a/cmd/update/interfaces/updater.go +++ b/cmd/update/interfaces/updater.go @@ -10,5 +10,5 @@ import ( //go:generate mockery -name=Updater -case=underscore type Updater interface { - UpdateNamedEntity(ctx context.Context, name string, project string, domain string, rsType core.ResourceType, cmdCtx cmdCore.CommandContext) error + UpdateNamedEntity(ctx context.Context, name, project, domain string, rsType core.ResourceType, cmdCtx cmdCore.CommandContext) error } diff --git a/cmd/update/named_entity.go b/cmd/update/named_entity.go index 5dc0d300..5c3391d7 100644 --- a/cmd/update/named_entity.go +++ b/cmd/update/named_entity.go @@ -26,7 +26,7 @@ func (n NamedEntityConfig) UpdateNamedEntity(ctx context.Context, name string, p archiveProject := n.Archive activateProject := n.Activate if activateProject == archiveProject && activateProject { - return fmt.Errorf(clierrors.ErrInvalidUpdate) + return fmt.Errorf(clierrors.ErrInvalidStateUpdate) } var nameEntityState admin.NamedEntityState if activateProject { diff --git a/cmd/update/project.go b/cmd/update/project.go index f84707e3..4568f814 100644 --- a/cmd/update/project.go +++ b/cmd/update/project.go @@ -78,7 +78,7 @@ func updateProjectsFunc(ctx context.Context, args []string, cmdCtx cmdCore.Comma archiveProject := projectConfig.ArchiveProject activateProject := projectConfig.ActivateProject if activateProject == archiveProject { - return fmt.Errorf(clierrors.ErrInvalidUpdate) + return fmt.Errorf(clierrors.ErrInvalidStateUpdate) } projectState := admin.Project_ACTIVE if archiveProject { @@ -90,7 +90,7 @@ func updateProjectsFunc(ctx context.Context, args []string, cmdCtx cmdCore.Comma }) if err != nil { fmt.Printf(clierrors.ErrFailedProjectUpdate, id, projectState, err) - return nil + return err } fmt.Printf("Project %v updated to %v state\n", id, projectState) return nil diff --git a/cmd/update/task.go b/cmd/update/task.go index 75f979db..e38cdff1 100644 --- a/cmd/update/task.go +++ b/cmd/update/task.go @@ -18,12 +18,12 @@ Following command updates the description on the task. flytectl update task -d development -p flytectldemo core.advanced.run_merge_sort.merge --description "Merge sort example" -Archiving task named entity would is not supported and would throw an error. +Archiving task named entity is not supported and would throw an error. :: flytectl update task -d development -p flytectldemo core.advanced.run_merge_sort.merge --archive -Activating workflow named entity would be a noop as archiving is not possible. +Activating task named entity would be a noop as archiving is not possible. :: flytectl update task -d development -p flytectldemo core.advanced.run_merge_sort.merge --activate