Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: abarreiro <abarreiro@vmware.com>
  • Loading branch information
adambarreiro committed May 17, 2024
1 parent cfedeb9 commit 260f0ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions govcd/cse/4.1/capiyaml_workerpool.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ kind: MachineDeployment
metadata:
name: "{{.NodePoolName}}"
namespace: "{{.TargetNamespace}}"
{{- if and (gt .AutoscalerMaxSize -1) (gt .AutoscalerMinSize -1) }}
{{- if and .AutoscalerMaxSize .AutoscalerMinSize}}
cluster.x-k8s.io/cluster-api-Autoscaler-node-group-max-size: "{{.AutoscalerMaxSize}}"
cluster.x-k8s.io/cluster-api-Autoscaler-node-group-min-size: "{{.AutoscalerMinSize}}"
{{- end}}
spec:
clusterName: "{{.ClusterName}}"
{{- if and (lt .AutoscalerMaxSize 0) (lt .AutoscalerMinSize 0) }}
{{- if .NodePoolMachineCount}}
replicas: {{.NodePoolMachineCount}}
{{- end}}
selector:
Expand Down
4 changes: 2 additions & 2 deletions govcd/cse/4.2/capiyaml_workerpool.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ kind: MachineDeployment
metadata:
name: "{{.NodePoolName}}"
namespace: "{{.TargetNamespace}}"
{{- if and (gt .AutoscalerMaxSize -1) (gt .AutoscalerMinSize -1) }}
{{- if and .AutoscalerMaxSize .AutoscalerMinSize}}
cluster.x-k8s.io/cluster-api-Autoscaler-node-group-max-size: "{{.AutoscalerMaxSize}}"
cluster.x-k8s.io/cluster-api-Autoscaler-node-group-min-size: "{{.AutoscalerMinSize}}"
{{- end}}
spec:
clusterName: "{{.ClusterName}}"
{{- if and (lt .AutoscalerMaxSize 0) (lt .AutoscalerMinSize 0) }}
{{- if .NodePoolMachineCount}}
replicas: {{.NodePoolMachineCount}}
{{- end}}
selector:
Expand Down
5 changes: 2 additions & 3 deletions govcd/cse_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,14 @@ func (clusterSettings *cseClusterSettingsInternal) generateWorkerPoolsYaml() (st
"NodePoolStorageProfile": wp.StorageProfileName,
"NodePoolDiskSize": fmt.Sprintf("%dGi", wp.DiskSizeGi),
"NodePoolEnableGpu": strconv.FormatBool(wp.VGpuPolicyName != ""),
"NodePoolMachineCount": strconv.Itoa(wp.MachineCount),
"AutoscalerMaxSize": "-1",
"AutoscalerMinSize": "-1",
"KubernetesVersion": clusterSettings.TkgVersionBundle.KubernetesVersion,
}

if wp.Autoscaler != nil {
args["AutoscalerMaxSize"] = strconv.Itoa(wp.Autoscaler.MaxSize)
args["AutoscalerMinSize"] = strconv.Itoa(wp.Autoscaler.MinSize)
} else {
args["NodePoolMachineCount"] = strconv.Itoa(wp.MachineCount)
}

if err := workerPools.Execute(buf, args); err != nil {
Expand Down

0 comments on commit 260f0ac

Please sign in to comment.