From bc3ba3e5e15e57aa7f4dd4b6127d3800b2be05c6 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Tue, 28 May 2024 12:56:23 -0700 Subject: [PATCH] Run make -c flytectl generate Signed-off-by: Eduardo Apolinario --- flytectl/cmd/create/executionconfig_flags.go | 3 ++- flytectl/cmd/create/executionconfig_flags_test.go | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/flytectl/cmd/create/executionconfig_flags.go b/flytectl/cmd/create/executionconfig_flags.go index 9908df93b1..897cc6ecce 100755 --- a/flytectl/cmd/create/executionconfig_flags.go +++ b/flytectl/cmd/create/executionconfig_flags.go @@ -51,8 +51,9 @@ func (ExecutionConfig) mustMarshalJSON(v json.Marshaler) string { func (cfg ExecutionConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags := pflag.NewFlagSet("ExecutionConfig", pflag.ExitOnError) cmdFlags.StringVar(&executionConfig.ExecFile, fmt.Sprintf("%v%v", prefix, "execFile"), executionConfig.ExecFile, "file for the execution params. If not specified defaults to <_name>.execution_spec.yaml") - cmdFlags.StringVar(&executionConfig.TargetDomain, fmt.Sprintf("%v%v", prefix, "targetDomain"), executionConfig.TargetDomain, "project where execution needs to be created. If not specified configured domain would be used.") + cmdFlags.StringVar(&executionConfig.TargetDomain, fmt.Sprintf("%v%v", prefix, "targetDomain"), executionConfig.TargetDomain, "domain where execution needs to be created. If not specified configured domain would be used.") cmdFlags.StringVar(&executionConfig.TargetProject, fmt.Sprintf("%v%v", prefix, "targetProject"), executionConfig.TargetProject, "project where execution needs to be created. If not specified configured project would be used.") + cmdFlags.StringVar(&executionConfig.TargetExecutionCluster, fmt.Sprintf("%v%v", prefix, "targetExecutionCluster"), executionConfig.TargetExecutionCluster, "cluster where execution needs to be created. If not specific the default would be used.") cmdFlags.StringVar(&executionConfig.KubeServiceAcct, fmt.Sprintf("%v%v", prefix, "kubeServiceAcct"), executionConfig.KubeServiceAcct, "kubernetes service account AuthRole for launching execution.") cmdFlags.StringVar(&executionConfig.IamRoleARN, fmt.Sprintf("%v%v", prefix, "iamRoleARN"), executionConfig.IamRoleARN, "iam role ARN AuthRole for launching execution.") cmdFlags.StringVar(&executionConfig.Relaunch, fmt.Sprintf("%v%v", prefix, "relaunch"), executionConfig.Relaunch, "execution id to be relaunched.") diff --git a/flytectl/cmd/create/executionconfig_flags_test.go b/flytectl/cmd/create/executionconfig_flags_test.go index 7891b4f9ba..e251b60c49 100755 --- a/flytectl/cmd/create/executionconfig_flags_test.go +++ b/flytectl/cmd/create/executionconfig_flags_test.go @@ -141,6 +141,20 @@ func TestExecutionConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_targetExecutionCluster", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("targetExecutionCluster", testValue) + if vString, err := cmdFlags.GetString("targetExecutionCluster"); err == nil { + testDecodeJson_ExecutionConfig(t, fmt.Sprintf("%v", vString), &actual.TargetExecutionCluster) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) t.Run("Test_kubeServiceAcct", func(t *testing.T) { t.Run("Override", func(t *testing.T) {