diff --git a/flytectl/cmd/config/subcommand/matchable_attr_file_config_utils.go b/flytectl/cmd/config/subcommand/matchable_attr_file_config_utils.go index cb573fda223..e160868f241 100644 --- a/flytectl/cmd/config/subcommand/matchable_attr_file_config_utils.go +++ b/flytectl/cmd/config/subcommand/matchable_attr_file_config_utils.go @@ -52,7 +52,7 @@ func DumpTaskResourceAttr(matchableAttrConfig interface{}, fileName string) erro if err := WriteConfigToFile(matchableAttrConfig, fileName); err != nil { return fmt.Errorf("error dumping in file due to %v", err) } - fmt.Printf("wrote the config to file %v", fileName) + fmt.Printf("wrote the config to file %v\n", fileName) } else { fmt.Printf("%v", String(matchableAttrConfig)) } diff --git a/flytectl/cmd/get/matchable_workflow_execution_config.go b/flytectl/cmd/get/matchable_workflow_execution_config.go index e9bd44a8cf7..76a18ac0be7 100644 --- a/flytectl/cmd/get/matchable_workflow_execution_config.go +++ b/flytectl/cmd/get/matchable_workflow_execution_config.go @@ -8,10 +8,9 @@ import ( sconfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand" "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/workflowexecutionconfig" cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core" + "github.com/flyteorg/flyte/flytectl/pkg/ext" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) const ( @@ -141,7 +140,7 @@ func getWorkflowExecutionConfigFunc(ctx context.Context, args []string, cmdCtx c // Updates the workflowExecutionConfigFileConfig with the fetched matchable attribute if err := FetchAndUnDecorateMatchableAttr(ctx, project, domain, workflowName, cmdCtx.AdminFetcherExt(), &workflowExecutionConfigFileConfig, admin.MatchableResource_WORKFLOW_EXECUTION_CONFIG); err != nil { - if grpcError := status.Code(err); grpcError == codes.NotFound && workflowexecutionconfig.DefaultFetchConfig.Gen { + if ext.IsNotFoundError(err) && workflowexecutionconfig.DefaultFetchConfig.Gen { fmt.Println("Generating a sample workflow execution config file") workflowExecutionConfigFileConfig = getSampleWorkflowExecutionFileConfig(project, domain, workflowName) } else {