Skip to content

Commit

Permalink
added template modifications for uuid in machineconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakm-ntnx committed Dec 5, 2022
1 parent ac8d541 commit f5e9e44
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
15 changes: 15 additions & 0 deletions pkg/providers/nutanix/config/md-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,29 @@ spec:
memorySize: {{.memorySize}}
systemDiskSize: {{.systemDiskSize}}
image:
{{- if and .imageIDType (eq .format "name") }}
type: name
name: "{{.imageName}}"
{{ else if and .imageIDType (eq .format "uuid") }}
type: uuid
name: "{{.imageUUID}}"
{{ end }}
cluster:
{{- if and .nutanixPEClusterIDType (eq .format "name") }}
type: name
name: "{{.nutanixPEClusterName}}"
{{- else if and .nutanixPEClusterIDType (eq .format "uuid") }}
type: uuid
name: "{{.nutanixPEClusterUUID}}"
{{ end }}
subnet:
{{- if and .subnetIDType (eq .format "name") }}
- type: name
name: "{{.subnetName}}"
{{- else if and .subnetIDType (eq .format "uuid") }}
- type: uuid
name: "{{.subnetUUID}}"
{{ end }}
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
Expand Down
12 changes: 9 additions & 3 deletions pkg/providers/nutanix/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,15 @@ func buildTemplateMapCP(
"vcpuSockets": controlPlaneMachineSpec.VCPUSockets,
"memorySize": controlPlaneMachineSpec.MemorySize.String(),
"systemDiskSize": controlPlaneMachineSpec.SystemDiskSize.String(),
"imageName": controlPlaneMachineSpec.Image.Name, // TODO(nutanix): pass name or uuid based on type of identifier
"nutanixPEClusterName": controlPlaneMachineSpec.Cluster.Name, // TODO(nutanix): pass name or uuid based on type of identifier
"subnetName": controlPlaneMachineSpec.Subnet.Name, // TODO(nutanix): pass name or uuid based on type of identifier
"imageIDType": controlPlaneMachineSpec.Image.Type,
"imageName": controlPlaneMachineSpec.Image.Name,
"imageUUID": controlPlaneMachineSpec.Image.UUID,
"nutanixPEClusterIDType": controlPlaneMachineSpec.Cluster.Type,
"nutanixPEClusterName": controlPlaneMachineSpec.Cluster.Name,
"nutanixPEClusterUUID": controlPlaneMachineSpec.Cluster.UUID,
"subnetIDType": controlPlaneMachineSpec.Subnet.Type,
"subnetName": controlPlaneMachineSpec.Subnet.Name,
"subnetUUID": controlPlaneMachineSpec.Subnet.UUID,
}

if clusterSpec.Cluster.Spec.ExternalEtcdConfiguration != nil {
Expand Down

0 comments on commit f5e9e44

Please sign in to comment.