The scale-workers dry run fails on a cluster without nodes.json

The scale-workers phase rejects the dry-run option on a cluster that the installer created before nodes.json existed, because the first run must record the current workers.

The scale-workers phase with the --dry-run option stops with an error that states that nodes.json does not exist yet and that you must run the phase once without the option.

The cluster was created before the installer wrote nodes.json. On the first run, the phase counts the nodes of the cluster that are not control plane nodes, and records them as worker-1 through worker-N. A dry run must not write this record.

Resolution

To record the workers without changing the cluster, set INFRA_WORKER_COUNT to the current number of workers, and run the scale-workers phase one time without the --dry-run option. The phase writes nodes.json and reports that nothing else needs to change. Later runs, including dry runs, then work as usual.