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

Commit

Permalink
Fixed update project
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 27, 2021
1 parent b769819 commit d93e6b9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions cmd/update/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import (

"github.com/flyteorg/flytectl/cmd/config"
cmdCore "github.com/flyteorg/flytectl/cmd/core"
"github.com/flyteorg/flytectl/pkg/auth"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"

"google.golang.org/grpc"
)

//go:generate pflags ProjectConfig
Expand Down Expand Up @@ -84,10 +87,16 @@ func updateProjectsFunc(ctx context.Context, args []string, cmdCtx cmdCore.Comma
if archiveProject {
projectState = admin.Project_ARCHIVED
}
_, err := cmdCtx.AdminClient().UpdateProject(ctx, &admin.Project{
Id: id,
State: projectState,
})
var callOptions []grpc.CallOption
grpcAPICall := func(_ctx context.Context, _callOptions []grpc.CallOption) error {
var err error
_, err = cmdCtx.AdminClient().UpdateProject(ctx, &admin.Project{
Id: id,
State: projectState,
}, _callOptions...)
return err
}
err := auth.Do(ctx, cmdCtx.AuthClient(), grpcAPICall, callOptions)
if err != nil {
fmt.Printf(clierrors.ErrFailedProjectUpdate, id, projectState, err)
return err
Expand Down

0 comments on commit d93e6b9

Please sign in to comment.