Skip to content

Retain exit code in cloud-init status for recoverable errors

Ani Sinha requested to merge anisinha/cloud-init:fix-status-return-code into c9s

Jira: https://issues.redhat.com/browse/RHEL-28549

Version 23.4 of cloud-init changed the status code reported by cloud-init for
recoverable errors from 0 to 2. Please see the commit
70acb7f2a30d58 ("Add support for cloud-init "degraded" state (#4500)")

This change has the potential to break customers who are expecting a 0 status
and where warnings can be expected. Hence, revert the status code from 2 to 0
even in case of recoverable errors. This retains the old behavior and hence
avoids breaking scripts and software stack that expects 0 on the end user side.

Cannonical has made a similar change downstream for similar reasons. Please see
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2048522
and the corresponding downstream patch:
https://github.com/canonical/cloud-init/pull/4747/commits/adce34bfd214e4eecdf87329486f30f0898dd303

This patch has limited risk as it narrowly only restores the old status
code for recoverable errors and does not modify anything else.

X-downstream-only: true

Signed-off-by: Ani Sinha anisinha@redhat.com

Edited by Ani Sinha

Merge request reports