Skip to content

Commit

Permalink
fix: missing worker id on run kubectl and deploy kubernetes secret ac…
Browse files Browse the repository at this point in the history
…tion (#557)
  • Loading branch information
domenicsim1 authored Oct 19, 2023
1 parent 94550be commit 19fa565
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions octopusdeploy/schema_action_deploy_kubernetes_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions octopusdeploy/schema_action_run_kubectl_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ func getRunKubectlScriptSchema() *schema.Schema {
actionSchema, element := getActionSchema()
addExecutionLocationSchema(element)
addScriptFromPackageSchema(element)
addWorkerPoolSchema(element)
addWorkerPoolVariableSchema(element)
addPackagesSchema(element, false)
return actionSchema
}
Expand All @@ -35,6 +37,14 @@ func flattenKubernetesRunScriptAction(action *deployments.DeploymentAction) map[
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
}
Expand Down

0 comments on commit 19fa565

Please sign in to comment.