Skip to content

fix: call script expand-root-disk.sh conditionally#735

Merged
adrianriobo merged 1 commit intoredhat-developer:mainfrom
ppitonak:fix_expand_root_disk
Feb 26, 2026
Merged

fix: call script expand-root-disk.sh conditionally#735
adrianriobo merged 1 commit intoredhat-developer:mainfrom
ppitonak:fix_expand_root_disk

Conversation

@ppitonak
Copy link
Copy Markdown
Collaborator

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.

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>
@ppitonak
Copy link
Copy Markdown
Collaborator Author

Tested with AWS spot instances.

Copy link
Copy Markdown
Collaborator

@adrianriobo adrianriobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adrianriobo adrianriobo merged commit 071b9ba into redhat-developer:main Feb 26, 2026
7 checks passed
@ppitonak ppitonak deleted the fix_expand_root_disk branch March 9, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants