diff --git a/cmd/get/execution_util.go b/cmd/get/execution_util.go index 2a563f41..49998586 100644 --- a/cmd/get/execution_util.go +++ b/cmd/get/execution_util.go @@ -8,11 +8,13 @@ import ( "os" cmdCore "github.com/flyteorg/flytectl/cmd/core" + "github.com/flyteorg/flytectl/pkg/auth" cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils" "github.com/flyteorg/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" + "google.golang.org/grpc" "sigs.k8s.io/yaml" ) @@ -30,13 +32,20 @@ type ExecutionConfig struct { } func (f FetcherImpl) FetchExecution(ctx context.Context, name string, project string, domain string, cmdCtx cmdCore.CommandContext) (*admin.Execution, error) { - e, err := cmdCtx.AdminClient().GetExecution(ctx, &admin.WorkflowExecutionGetRequest{ - Id: &core.WorkflowExecutionIdentifier{ - Project: project, - Domain: domain, - Name: name, - }, - }) + var e *admin.Execution + var callOptions []grpc.CallOption + grpcAPICall := func(_ctx context.Context, _callOptions []grpc.CallOption) error { + var err error + e, err = cmdCtx.AdminClient().GetExecution(ctx, &admin.WorkflowExecutionGetRequest{ + Id: &core.WorkflowExecutionIdentifier{ + Project: project, + Domain: domain, + Name: name, + }, + }, _callOptions...) + return err + } + err := auth.Do(ctx, cmdCtx.AuthClient(), grpcAPICall, callOptions) if err != nil { return nil, err }