Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/missing worker id on kubectl action #557

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading