diff --git a/octopusdeploy/schema_kubernetes_agent_deployment_target.go b/octopusdeploy/schema_kubernetes_agent_deployment_target.go index 2323f311..6bfd0d47 100644 --- a/octopusdeploy/schema_kubernetes_agent_deployment_target.go +++ b/octopusdeploy/schema_kubernetes_agent_deployment_target.go @@ -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 { @@ -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 } diff --git a/octopusdeploy/schema_kubernetes_agent_worker.go b/octopusdeploy/schema_kubernetes_agent_worker.go index 8c6f1e75..32c0c6e2 100644 --- a/octopusdeploy/schema_kubernetes_agent_worker.go +++ b/octopusdeploy/schema_kubernetes_agent_worker.go @@ -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 { @@ -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 }