Skip to content

Commit 971f9fd

Browse files
berkitamasbrandond
authored andcommitted
Handle Helm superseded state
Resolves: k3s-io/helm-controller#285 Signed-off-by: Tamas Berki <Tamas.Berki@gmail.com>
1 parent bbfdb04 commit 971f9fd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

entry

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ helm_update() {
2727
exit
2828
fi
2929

30-
# If a previous helm operation was interrupted unexpectedly, set it to failed.
31-
if [[ "${STATUS}" =~ ^(pending-install|pending-upgrade|pending-rollback|uninstalling)$ ]]; then
30+
# If a previous helm operation was interrupted unexpectedly or release state is corrupted, set it to failed.
31+
if [[ "${STATUS}" =~ ^(pending-install|pending-upgrade|pending-rollback|superseded|uninstalling)$ ]]; then
3232
echo Previous helm job was interrupted, updating status from ${STATUS} to failed
3333
echo "Resetting ${HELM} release status from '${STATUS}' to 'failed'" >> ${TERM_LOG}
3434
${HELM} set-status ${NAME} failed --namespace ${TARGET_NAMESPACE}
3535

3636
# Upgrades can be retried; install and rollback will be handled as failure below.
37+
# If release state is superseded, chart deployment might be correct, try an upgrade first.
3738
# If this upgrade also fails, retries of the job will handle that as failure due to the release state change.
38-
if [[ "${STATUS}" == "pending-upgrade" ]]; then
39+
if [[ "${STATUS}" =~ ^(pending-upgrade|superseded)$ ]]; then
3940
echo "Retrying upgrade of ${HELM} chart" >> ${TERM_LOG}
4041
echo "Retrying upgrade of ${NAME}"
4142
shift 1

0 commit comments

Comments
 (0)