Skip to content

Disable errexit for kubectl diff#401

Merged
blaggacao merged 2 commits intodivnix:mainfrom
whs-dot-hk:fix-kubectl-diff
May 16, 2025
Merged

Disable errexit for kubectl diff#401
blaggacao merged 2 commits intodivnix:mainfrom
whs-dot-hk:fix-kubectl-diff

Conversation

@whs-dot-hk
Copy link
Contributor

Greetings @blaggacao, find the github actions exit unexpectedly after running the kubectl diff command.

Problem

When there is difference kubectl diff will return exit status 1. If we have set -o errexit the script will exit after that command.

Solution

Wrap kubectl diff command with following

set +o errexit
kubectl diff ...
set -o errexit

@blaggacao blaggacao merged commit 29f79b7 into divnix:main May 16, 2025
7 of 8 checks passed
@blaggacao
Copy link
Collaborator

Nice catch! Thank's a ton! 🤝

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