From bbee8103ebfd0613c918167a00c4ec05053a54be Mon Sep 17 00:00:00 2001 From: Ahmad Murzahmatov Date: Fri, 6 Jun 2025 10:58:58 +0600 Subject: [PATCH] [fix] vm-instance: cloud-init made same change as in [PR](https://github.com/cozystack/cozystack/pull/1019) Signed-off-by: Ahmad Murzahmatov --- packages/apps/versions_map | 4 ++-- packages/apps/virtual-machine/Chart.yaml | 2 +- packages/apps/vm-instance/Chart.yaml | 2 +- packages/apps/vm-instance/templates/vm.yaml | 22 +++++++++++++++------ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/packages/apps/versions_map b/packages/apps/versions_map index 4265b8a7..d0308211 100644 --- a/packages/apps/versions_map +++ b/packages/apps/versions_map @@ -171,7 +171,7 @@ virtual-machine 0.8.2 de19450f virtual-machine 0.9.0 721c12a7 virtual-machine 0.9.1 93bdf411 virtual-machine 0.10.0 6130f43d -virtual-machine 0.10.1 HEAD +virtual-machine 0.10.2 HEAD vm-disk 0.1.0 d971f2ff vm-disk 0.1.1 6130f43d vm-disk 0.1.2 HEAD @@ -184,7 +184,7 @@ vm-instance 0.5.0 3fa4dd3a vm-instance 0.5.1 de19450f vm-instance 0.6.0 721c12a7 vm-instance 0.7.0 6130f43d -vm-instance 0.7.1 HEAD +vm-instance 0.7.2 HEAD vpn 0.1.0 263e47be vpn 0.2.0 53f2365e vpn 0.3.0 6c5cf5bf diff --git a/packages/apps/virtual-machine/Chart.yaml b/packages/apps/virtual-machine/Chart.yaml index 152ccb73..8a3189b8 100644 --- a/packages/apps/virtual-machine/Chart.yaml +++ b/packages/apps/virtual-machine/Chart.yaml @@ -17,7 +17,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.10.1 +version: 0.10.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/packages/apps/vm-instance/Chart.yaml b/packages/apps/vm-instance/Chart.yaml index 60a72d5f..1208a0f3 100644 --- a/packages/apps/vm-instance/Chart.yaml +++ b/packages/apps/vm-instance/Chart.yaml @@ -17,7 +17,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.7.1 +version: 0.7.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/packages/apps/vm-instance/templates/vm.yaml b/packages/apps/vm-instance/templates/vm.yaml index 8b647e70..a99492f0 100644 --- a/packages/apps/vm-instance/templates/vm.yaml +++ b/packages/apps/vm-instance/templates/vm.yaml @@ -94,17 +94,27 @@ spec: dataVolume: name: vm-disk-{{ .name }} {{- end }} - {{- if or .Values.sshKeys .Values.cloudInit }} + {{- if and .Values.sshKeys .Values.cloudInit }} - name: cloudinitdisk cloudInitNoCloud: - {{- if .Values.cloudInit }} secretRef: name: {{ include "virtual-machine.fullname" . }}-cloud-init - {{- else }} + {{- else if .Values.sshKeys }} + - name: cloudinitdisk + cloudInitNoCloud: userData: | - #cloud-config - final_message: Cloud-init user-data was left blank intentionally. - {{- end }} + {{ printf "%s" "#cloud-config" }} + ssh_authorized_keys: + {{- range .Values.sshKeys }} + - {{ . }} + {{- end }} + chpasswd: + expire: false + {{- else }} + - name: cloudinitdisk + cloudInitNoCloud: + userData: | + {{ printf "%s" "#cloud-config" }} {{- end }} networks: - name: default