diff --git a/charts/t8s-cluster/templates/_helpers.tpl b/charts/t8s-cluster/templates/_helpers.tpl index d57b0c45e..66c7f55da 100644 --- a/charts/t8s-cluster/templates/_helpers.tpl +++ b/charts/t8s-cluster/templates/_helpers.tpl @@ -30,5 +30,5 @@ sourceRef: {{- $hasGPUFlavor = true -}} {{- end -}} {{- end -}} - {{- $hasGPUFlavor -}} + {{- $hasGPUFlavor | ternary true "" -}} {{- end -}} diff --git a/charts/t8s-cluster/templates/management-cluster/cluster.yaml b/charts/t8s-cluster/templates/management-cluster/cluster.yaml index e4a046f88..02f2a12f7 100644 --- a/charts/t8s-cluster/templates/management-cluster/cluster.yaml +++ b/charts/t8s-cluster/templates/management-cluster/cluster.yaml @@ -41,3 +41,6 @@ spec: {{- end }} bastion: enabled: false + {{- with .Values.openstackImageNamePrefix }} + openStackImageNamePrefix: {{ . | quote }} + {{- end }} diff --git a/charts/t8s-cluster/templates/management-cluster/clusterClass/clusterClass.yaml b/charts/t8s-cluster/templates/management-cluster/clusterClass/clusterClass.yaml index dec148474..2cf4fd8e3 100644 --- a/charts/t8s-cluster/templates/management-cluster/clusterClass/clusterClass.yaml +++ b/charts/t8s-cluster/templates/management-cluster/clusterClass/clusterClass.yaml @@ -120,7 +120,7 @@ spec: op: add path: /spec/template/spec/image valueFrom: - template: {{ .Values.imageNameTemplate.computePlane }} + template: {{ printf "t8s-engine-%s{{ .builtin.machineDeployment.version }}" .Values.openstackImageNamePrefix }} selector: &imagePatchSelector apiVersion: {{ include "t8s-cluster.clusterClass.infrastructureApiVersion" (dict) }} kind: OpenStackMachineTemplate @@ -130,7 +130,7 @@ spec: - jsonPatches: - <<: *imagePatch valueFrom: - template: {{ .Values.imageNameTemplate.controlPlane }} + template: {{ printf "t8s-engine-%s{{ .builtin.controlPlane.version }}" .Values.openstackImageNamePrefix }} selector: <<: *imagePatchSelector matchResources: diff --git a/charts/t8s-cluster/values.schema.json b/charts/t8s-cluster/values.schema.json index 847c43d9d..8551fabe7 100644 --- a/charts/t8s-cluster/values.schema.json +++ b/charts/t8s-cluster/values.schema.json @@ -244,21 +244,8 @@ "calico" ] }, - "imageNameTemplate": { - "type": "object", - "properties": { - "computePlane": { - "type": "string" - }, - "controlPlane": { - "type": "string" - } - }, - "required": [ - "computePlane", - "controlPlane" - ], - "additionalProperties": false + "openstackImageNamePrefix": { + "type": "string" }, "common": { "type": "object", @@ -269,6 +256,7 @@ "metadata", "version", "controlPlane", + "openstackImageNamePrefix", "nodePools" ], "additionalProperties": false, diff --git a/charts/t8s-cluster/values.yaml b/charts/t8s-cluster/values.yaml index 1c0c60fe7..5d34611d5 100644 --- a/charts/t8s-cluster/values.yaml +++ b/charts/t8s-cluster/values.yaml @@ -10,7 +10,7 @@ global: url: https://helm.ngc.nvidia.com/nvidia charts: gpu-operator: 23.x.x - condition: '{{ eq (include "t8s-cluster.hasGPUNodes" (dict "context" $)) "true" }}' + condition: '{{ include "t8s-cluster.hasGPUNodes" (dict "context" $) }}' cloud-provider-openstack: url: https://kubernetes.github.io/cloud-provider-openstack cetic: @@ -69,6 +69,4 @@ sshKeyName: null cni: cilium -imageNameTemplate: - computePlane: t8s-engine-{{ .builtin.machineDeployment.version }} - controlPlane: t8s-engine-{{ .builtin.controlPlane.version }} +openstackImageNamePrefix: ""