Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
adding fields to specify that we should autoscale a cluster.
Browse files Browse the repository at this point in the history
  • Loading branch information
JackQuincy committed Jul 10, 2018
1 parent acac8b0 commit 0b17d3f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/api/agentPoolOnlyApi/v20180331/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/agentPoolOnlyApi/vlabs/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/converterfromagentpoolonlyapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions pkg/api/convertertoagentpoolonlyapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b17d3f

Please sign in to comment.