From 0b17d3f19c0e71793c365f4b081cc5db90ceaca5 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Jul 2018 15:05:47 -0700 Subject: [PATCH] adding fields to specify that we should autoscale a cluster. --- pkg/api/agentPoolOnlyApi/v20180331/types.go | 3 +++ pkg/api/agentPoolOnlyApi/vlabs/types.go | 3 +++ pkg/api/converterfromagentpoolonlyapi.go | 3 +++ pkg/api/convertertoagentpoolonlyapi.go | 6 ++++++ pkg/api/types.go | 3 +++ 5 files changed, 18 insertions(+) diff --git a/pkg/api/agentPoolOnlyApi/v20180331/types.go b/pkg/api/agentPoolOnlyApi/v20180331/types.go index 0ef4b7abf3..cc9fd3c783 100644 --- a/pkg/api/agentPoolOnlyApi/v20180331/types.go +++ b/pkg/api/agentPoolOnlyApi/v20180331/types.go @@ -183,6 +183,9 @@ type AgentPoolProfile struct { StorageProfile string `json:"storageProfile" validate:"eq=ManagedDisks|len=0"` VnetSubnetID string `json:"vnetSubnetID,omitempty"` MaxPods *int `json:"maxPods,omitempty"` + MaxCount *int `json:"maxCount,omitempty"` + MinCount *int `json:"minCount,omitempty"` + AutoscalePool bool `json:"autoscalePool,omitempty"` // OSType is the operating system type for agents // Set as nullable to support backward compat because diff --git a/pkg/api/agentPoolOnlyApi/vlabs/types.go b/pkg/api/agentPoolOnlyApi/vlabs/types.go index ded6078062..c4d7d449f2 100644 --- a/pkg/api/agentPoolOnlyApi/vlabs/types.go +++ b/pkg/api/agentPoolOnlyApi/vlabs/types.go @@ -129,6 +129,9 @@ type AgentPoolProfile struct { AvailabilityProfile string `json:"availabilityProfile"` StorageProfile string `json:"storageProfile" validate:"eq=StorageAccount|eq=ManagedDisks|len=0"` VnetSubnetID string `json:"vnetSubnetID,omitempty"` + MaxCount *int `json:"maxCount,omitempty"` + MinCount *int `json:"minCount,omitempty"` + AutoscalePool bool `json:"autoscalePool,omitempty"` // OSType is the operating system type for agents // Set as nullable to support backward compat because diff --git a/pkg/api/converterfromagentpoolonlyapi.go b/pkg/api/converterfromagentpoolonlyapi.go index 0772df6a06..9f3945361a 100644 --- a/pkg/api/converterfromagentpoolonlyapi.go +++ b/pkg/api/converterfromagentpoolonlyapi.go @@ -251,6 +251,9 @@ func convertAgentPoolProfileToV20180331AgentPoolOnly(api *AgentPoolProfile, p *v p.MaxPods = &agentPoolMaxPods } } + p.AutoscalePool = api.AutoscalePool + p.MaxCount = api.MaxCount + p.MinCount = api.MinCount } func convertServicePrincipalProfileToV20180331AgentPoolOnly(api *ServicePrincipalProfile, v20180331 *v20180331.ServicePrincipalProfile) { diff --git a/pkg/api/convertertoagentpoolonlyapi.go b/pkg/api/convertertoagentpoolonlyapi.go index df6e219204..63c92ab51a 100644 --- a/pkg/api/convertertoagentpoolonlyapi.go +++ b/pkg/api/convertertoagentpoolonlyapi.go @@ -270,6 +270,9 @@ func convertVLabsAgentPoolOnlyAgentPoolProfile(vlabs *vlabs.AgentPoolProfile, ap api.AvailabilityProfile = vlabs.AvailabilityProfile api.VnetSubnetID = vlabs.VnetSubnetID api.Subnet = vlabs.GetSubnet() + api.AutoscalePool = vlabs.AutoscalePool + api.MinCount = vlabs.MinCount + api.MaxCount = vlabs.MaxCount } func convertVLabsAgentPoolOnlyServicePrincipalProfile(vlabs *vlabs.ServicePrincipalProfile, api *ServicePrincipalProfile) { @@ -502,6 +505,9 @@ func convertV20180331AgentPoolOnlyAgentPoolProfile(agentPoolProfile *v20180331.A api.KubernetesConfig = kubernetesConfig api.Subnet = agentPoolProfile.GetSubnet() api.AvailabilityProfile = availabilityProfile + api.MaxCount = agentPoolProfile.MaxCount + api.MinCount = agentPoolProfile.MinCount + api.AutoscalePool = agentPoolProfile.AutoscalePool return api } diff --git a/pkg/api/types.go b/pkg/api/types.go index 5fc5793b40..147a637d39 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -449,6 +449,9 @@ type AgentPoolProfile struct { Extensions []Extension `json:"extensions"` KubernetesConfig *KubernetesConfig `json:"kubernetesConfig,omitempty"` ImageRef *ImageReference `json:"imageReference,omitempty"` + MaxCount *int `json:"maxCount,omitempty"` + MinCount *int `json:"minCount,omitempty"` + AutoscalePool bool `json:"autoscalePool,omitempty"` } // AgentPoolProfileRole represents an agent role