From 7ff26a7b6f2f77635769e4c3632dd63ff683fc47 Mon Sep 17 00:00:00 2001 From: Domenic Simone Date: Thu, 19 Oct 2023 16:56:30 +1100 Subject: [PATCH 1/3] fix: missing worker id on run kubectl script --- octopusdeploy/schema_action_run_kubectl_script.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/octopusdeploy/schema_action_run_kubectl_script.go b/octopusdeploy/schema_action_run_kubectl_script.go index be54afbbd..bf41d6d64 100644 --- a/octopusdeploy/schema_action_run_kubectl_script.go +++ b/octopusdeploy/schema_action_run_kubectl_script.go @@ -12,6 +12,8 @@ func getRunKubectlScriptSchema() *schema.Schema { actionSchema, element := getActionSchema() addExecutionLocationSchema(element) addScriptFromPackageSchema(element) + addWorkerPoolSchema(element) + addWorkerPoolVariableSchema(element) addPackagesSchema(element, false) return actionSchema } @@ -28,7 +30,7 @@ func expandRunKubectlScriptAction(flattenedAction map[string]interface{}) *deplo } func flattenKubernetesRunScriptAction(action *deployments.DeploymentAction) map[string]interface{} { - flattenedAction := flattenAction(action) + flattenedAction := flattenDeploymentAction(action) if v, ok := action.Properties["Octopus.Action.RunOnServer"]; ok { runOnServer, _ := strconv.ParseBool(v.Value) From f6827f218f16691961dfc53ca53a83091bb9bb02 Mon Sep 17 00:00:00 2001 From: Domenic Simone Date: Thu, 19 Oct 2023 17:08:33 +1100 Subject: [PATCH 2/3] chore: patch --- octopusdeploy/schema_action_run_kubectl_script.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/octopusdeploy/schema_action_run_kubectl_script.go b/octopusdeploy/schema_action_run_kubectl_script.go index bf41d6d64..edcf15caa 100644 --- a/octopusdeploy/schema_action_run_kubectl_script.go +++ b/octopusdeploy/schema_action_run_kubectl_script.go @@ -30,13 +30,21 @@ func expandRunKubectlScriptAction(flattenedAction map[string]interface{}) *deplo } func flattenKubernetesRunScriptAction(action *deployments.DeploymentAction) map[string]interface{} { - flattenedAction := flattenDeploymentAction(action) + flattenedAction := flattenAction(action) if v, ok := action.Properties["Octopus.Action.RunOnServer"]; ok { runOnServer, _ := strconv.ParseBool(v.Value) flattenedAction["run_on_server"] = runOnServer } + if len(action.WorkerPool) > 0 { + flattenedAction["worker_pool_id"] = action.WorkerPool + } + + if len(action.WorkerPoolVariable) > 0 { + flattenedAction["worker_pool_variable"] = action.WorkerPoolVariable + } + if v, ok := action.Properties["Octopus.Action.Script.ScriptFileName"]; ok { flattenedAction["script_file_name"] = v.Value } From 5c75d8a4bd07ace35942c74810d65fae398b0e94 Mon Sep 17 00:00:00 2001 From: Domenic Simone Date: Thu, 19 Oct 2023 21:09:54 +1100 Subject: [PATCH 3/3] fix: missing worker id on deploy_kubernetes_secret_action --- .../schema_action_deploy_kubernetes_secret.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/octopusdeploy/schema_action_deploy_kubernetes_secret.go b/octopusdeploy/schema_action_deploy_kubernetes_secret.go index 85718f9a2..83629dea6 100644 --- a/octopusdeploy/schema_action_deploy_kubernetes_secret.go +++ b/octopusdeploy/schema_action_deploy_kubernetes_secret.go @@ -37,6 +37,14 @@ func flattenDeployKubernetesSecretAction(action *deployments.DeploymentAction) m flattenedAction["secret_name"] = v.Value } + if len(action.WorkerPool) > 0 { + flattenedAction["worker_pool_id"] = action.WorkerPool + } + + if len(action.WorkerPoolVariable) > 0 { + flattenedAction["worker_pool_variable"] = action.WorkerPoolVariable + } + if v, ok := action.Properties["Octopus.Action.KubernetesContainers.SecretValues"]; ok { var secretKeyValues map[string]string json.Unmarshal([]byte(v.Value), &secretKeyValues) @@ -50,6 +58,8 @@ func flattenDeployKubernetesSecretAction(action *deployments.DeploymentAction) m func getDeployKubernetesSecretActionSchema() *schema.Schema { actionSchema, element := getActionSchema() addExecutionLocationSchema(element) + addWorkerPoolSchema(element) + addWorkerPoolVariableSchema(element) element.Schema["secret_name"] = &schema.Schema{ Description: "The name of the secret resource", Required: true,