Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Incorporated the feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Prafulla Mahindrakar <[email protected]>
  • Loading branch information
pmahindrakar-oss committed Apr 18, 2021
1 parent a70f997 commit 7d28004
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clierrors/errors.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cmd/update/interfaces/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion cmd/update/named_entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions cmd/update/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cmd/update/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d28004

Please sign in to comment.