Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(helm): Exit init script immediately on error #16758

Merged
merged 1 commit into from
Sep 27, 2021

Conversation

sourcecode-glitch
Copy link
Contributor

SUMMARY

This adds set -eu to the init script. With this the script will exit immediately when it encounters an error or an unset variable.

TESTING INSTRUCTIONS

In order to test that this works you will need a k8s environment. One way to test this is to manually add an error into the init script by including an invalid command (just make sure that the last command in the script is still a working command). Then start a helm deployment. Without this PR the init job will be marked as success despite the error. With this PR applied the init job will be marked as failed.

ADDITIONAL INFORMATION

  • Has associated issue: Fixes [Helm Chart] Init job marked as success despite errors #16757
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

ADDITIONAL THOUGHTS

I personally think failing when an error occurs should be the default behavior. However, I could see that some people might prefer it if the script does not fail and instead tries the remaining init steps. If this is wanted I could add a flag to the init config in values.yaml so that users can easily select the behavior they want. Let me know if this is wanted or if this PR is ok as it is. I personally don't really think it's worth including a switch, because with the current behavior you would need to read the whole init job logs in order to know if there were any problems.

@sourcecode-glitch sourcecode-glitch changed the title fix(helm): Exit init script immediately on error [WIP] fix(helm): Exit init script immediately on error Sep 21, 2021
@sourcecode-glitch sourcecode-glitch marked this pull request as draft September 21, 2021 11:00
@sourcecode-glitch sourcecode-glitch marked this pull request as ready for review September 23, 2021 07:46
@sourcecode-glitch sourcecode-glitch changed the title [WIP] fix(helm): Exit init script immediately on error ix(helm): Exit init script immediately on error Sep 23, 2021
@sourcecode-glitch sourcecode-glitch changed the title ix(helm): Exit init script immediately on error fix(helm): Exit init script immediately on error Sep 23, 2021
Copy link
Member

@craig-rueda craig-rueda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a version bump

@sourcecode-glitch
Copy link
Contributor Author

sourcecode-glitch commented Sep 26, 2021

Bumped helm chart version to 0.3.9 and rebased onto current master (CI didn't seem to work on the older master commit that this was based on before)

@craig-rueda craig-rueda merged commit ef95458 into apache:master Sep 27, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Helm Chart] Init job marked as success despite errors
3 participants