Commit 071b9ba
fix: call script expand-root-disk.sh conditionally
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>1 parent 394b17e commit 071b9ba
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
0 commit comments