fix: call script expand-root-disk.sh conditionally#735
Merged
adrianriobo merged 1 commit intoredhat-developer:mainfrom Feb 26, 2026
Merged
fix: call script expand-root-disk.sh conditionally#735adrianriobo merged 1 commit intoredhat-developer:mainfrom
adrianriobo merged 1 commit intoredhat-developer:mainfrom
Conversation
Commit 394b17e ("fix(rhel): grow disk size to external volume size", Feb 24) introduced a bug. In the cloud-config-base template at line 17, write_files: is unconditional, but all the entries underneath it are conditional. When none of the conditions are true (no ExpandRootDisk, no ActionsRunnerSnippet, no CirrusSnippet, no GitLabSnippet), the generated YAML becomes: write_files: This makes write_files equal to null in YAML, and cloud-init's cc_write_files module crashes with 'NoneType' object is not iterable when it tries to iterate over the entries. Additionally, the template also unconditionally runs /usr/local/bin/expand-root-disk.sh in runcmd, which would also fail on AWS since the script is never written. Signed-off-by: Pavol Pitonak <ppitonak@redhat.com>
Collaborator
Author
|
Tested with AWS spot instances. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit 394b17e ("fix(rhel): grow disk size to external volume size", Feb 24) introduced a bug. In the cloud-config-base template at line 17, write_files: is unconditional, but all the entries underneath it are conditional. When none of the conditions are true (no ExpandRootDisk, no ActionsRunnerSnippet, no CirrusSnippet, no GitLabSnippet), the generated YAML becomes:
write_files:
This makes write_files equal to null in YAML, and cloud-init's cc_write_files module crashes with 'NoneType' object is not iterable when it tries to iterate over the entries.
Additionally, the template also unconditionally runs /usr/local/bin/expand-root-disk.sh in runcmd, which would also fail on AWS since the script is never written.