Skip to content

Commit

Permalink
fix: respect machine policy id in kubernetes agent deployment target (#…
Browse files Browse the repository at this point in the history
…807)

* fix: respect machine policy id in kubernetes agent deployment target

* fix: respect machine policy id in kubernetes agent worker
  • Loading branch information
susanpann authored Oct 30, 2024
1 parent 146249b commit 794878b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion octopusdeploy/schema_kubernetes_agent_deployment_target.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package octopusdeploy

import (
"net/url"

"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/machines"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"net/url"
)

func expandKubernetesAgentDeploymentTarget(kubernetesAgent *schema.ResourceData) *machines.DeploymentTarget {
Expand All @@ -30,6 +31,8 @@ func expandKubernetesAgentDeploymentTarget(kubernetesAgent *schema.ResourceData)
deploymentTarget.TenantTags = expandArray(kubernetesAgent.Get("tenant_tags").([]interface{}))
deploymentTarget.SpaceID = kubernetesAgent.Get("space_id").(string)

deploymentTarget.MachinePolicyID = kubernetesAgent.Get("machine_policy_id").(string)

return deploymentTarget
}

Expand Down
5 changes: 4 additions & 1 deletion octopusdeploy/schema_kubernetes_agent_worker.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package octopusdeploy

import (
"net/url"

"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/machines"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"net/url"
)

func expandKubernetesAgentWorker(kubernetesAgent *schema.ResourceData) *machines.Worker {
Expand All @@ -24,6 +25,8 @@ func expandKubernetesAgentWorker(kubernetesAgent *schema.ResourceData) *machines

Worker.SpaceID = kubernetesAgent.Get("space_id").(string)

Worker.MachinePolicyID = kubernetesAgent.Get("machine_policy_id").(string)

return Worker
}

Expand Down

0 comments on commit 794878b

Please sign in to comment.