[fix] CloudInit - #1019
Conversation
WalkthroughThe update refines the conditional logic in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/apps/virtual-machine/templates/vm.yaml(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test
🔇 Additional comments (1)
packages/apps/virtual-machine/templates/vm.yaml (1)
98-107: AccessCredentials injection correctly scoped to SSH keys
Good use ofaccessCredentialsto inject SSH public keys only when.Values.sshKeysis defined. Passing the root context ($) intoincludeensures the VM name is resolved correctly.
| - name: systemdisk | ||
| dataVolume: | ||
| name: {{ include "virtual-machine.fullname" . }} | ||
|
|
||
| {{- if and .Values.sshKeys .Values.cloudInit }} | ||
| - name: cloudinitdisk | ||
| cloudInitNoCloud: | ||
| secretRef: | ||
| name: {{ include "virtual-machine.fullname" . }}-cloud-init | ||
| {{- else if .Values.sshKeys }} | ||
| - name: cloudinitdisk | ||
| cloudInitNoCloud: | ||
| userData: | | ||
| {{ printf "%s" "#cloud-config" }} | ||
| users: | ||
| - name: ubuntu | ||
| ssh_authorized_keys: | ||
| {{- range .Values.sshKeys }} | ||
| - {{ . }} | ||
| {{- end }} | ||
| chpasswd: | ||
| expire: false | ||
| {{- else }} | ||
| userData: | | ||
| #cloud-config | ||
| final_message: Cloud-init user-data was left blank intentionally. | ||
| - name: cloudinitdisk | ||
| cloudInitNoCloud: | ||
| userData: | | ||
| {{ printf "%s" "#cloud-config" }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
There was a problem hiding this comment.
Missing CloudInit-only volume handling
The volumes block currently only distinguishes “both SSH+CloudInit” and “SSH-only” cases, then falls back to a minimal header for all others. A CloudInit‐only scenario (.Values.cloudInit set, no .Values.sshKeys) ends up mounting an empty stub instead of the user’s CloudInit config, defeating the PR’s goal of supporting standalone CloudInit.
Introduce a dedicated branch for CloudInit‐only, for example:
- {{- if and .Values.sshKeys .Values.cloudInit }}
- name: cloudinitdisk
cloudInitNoCloud:
secretRef:
name: {{ include "virtual-machine.fullname" . }}-cloud-init
- {{- else if .Values.sshKeys }}
- name: cloudinitdisk
cloudInitNoCloud:
userData: |
{{ printf "%s" "#cloud-config" }}
users:
- name: ubuntu
ssh_authorized_keys:
{{- range .Values.sshKeys }}
- {{ . }}
{{- end }}
chpasswd:
expire: false
- {{- else }}
- name: cloudinitdisk
cloudInitNoCloud:
userData: |
{{ printf "%s" "#cloud-config" }}
- {{- end }}
+ {{- if and .Values.sshKeys .Values.cloudInit }}
...same as before...
+ {{- else if .Values.sshKeys }}
...same as before...
+ {{- else if .Values.cloudInit }}
- name: cloudinitdisk
cloudInitNoCloud:
secretRef:
name: {{ include "virtual-machine.fullname" . }}-cloud-init
+ {{- else }}
- name: cloudinitdisk
cloudInitNoCloud:
userData: |
{{ printf "%s" "#cloud-config" }}
+ {{- end }}Ensure the branch correctly references the intended secret or field for standalone CloudInit content.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In packages/apps/virtual-machine/templates/vm.yaml around lines 112 to 140, the
volumes block lacks a specific case for CloudInit-only configuration, causing it
to mount an empty stub instead of the user's CloudInit config when
.Values.cloudInit is true but .Values.sshKeys is not set. Add a dedicated
conditional branch that checks for CloudInit-only (true .Values.cloudInit and
false or empty .Values.sshKeys) and configure the cloudInitdisk volume to
reference the correct secret or userData for standalone CloudInit content,
ensuring the volume mounts the intended CloudInit configuration properly.
268b6dd to
ea40fe5
Compare
f99c474 to
23a88e1
Compare
Made same changes as in [PR](#1019) Signed-off-by: Ahmad Murzahmatov <gwynbleid2106@yandex.com>
Made same changes as in [PR](#1019) Signed-off-by: Ahmad Murzahmatov <gwynbleid2106@yandex.com>
This PR prepares the release `v0.31.0-rc.3`. Signed-off by: Timofei Larkin <lllamnyp@gmail.com>
23a88e1 to
6493602
Compare
Made same changes as in [PR](#1019) Signed-off-by: Ahmad Murzahmatov <gwynbleid2106@yandex.com>
Made same changes as in [PR](#1019) Signed-off-by: Ahmad Murzahmatov <gwynbleid2106@yandex.com>
Made same changes as in [PR](#1019) Signed-off-by: Ahmad Murzahmatov <gwynbleid2106@yandex.com>
Made same changes as in [PR](#1019) Signed-off-by: Ahmad Murzahmatov <gwynbleidd2106@yandex.com>
made same change as in
(PR){#1019}
Signed-off-by: Ahmad Murzahmatov <gwynbleidd2106@yandex.com>
made same change as in
(PR){#1019}
Signed-off-by: Ahmad Murzahmatov <gwynbleidd2106@yandex.com>
made same change as in
(PR){#1019}
Signed-off-by: Ahmad Murzahmatov <gwynbleidd2106@yandex.com>
made same change as in [PR](#1019) Signed-off-by: Ahmad Murzahmatov <gwynbleidd2106@yandex.com>
Made same changes as in [PR](#1019) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for defining a system disk with customizable storage and image sources for virtual machines. - **Improvements** - Enhanced cloud-init configuration to require both SSH keys and cloud-init data for certain volume setups, improving user data handling. - Simplified disk configuration for virtual machines, making setup more straightforward. - Shortened and clarified error messages for missing configuration fields. - **Chores** - Updated chart and package versions for virtual-machine and vm-instance applications. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
If ssh key provided - deploy
If cloudinit provided - deploy
If ssh key and cloudinit provided - deploy both
If none provided - init empty to avoid issues w/
network
Summary by CodeRabbit