Skip to content

Stabilize the ordering of initContainers #923

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

Merged
merged 7 commits into from
May 22, 2025
Merged

Stabilize the ordering of initContainers #923

merged 7 commits into from
May 22, 2025

Conversation

EronWright
Copy link
Contributor

@EronWright EronWright commented May 21, 2025

Proposed changes

This PR is a breaking API change to ensure that a workspace's built-in init containers (bootstrap, fetch) are declared before any extra init containers found in the podTemplate.

Implementation-wise, the desired ordering is achieved with the $setElementOrder directive, as documented here:
https://github.com/kubernetes/design-proposals-archive/blob/main/cli/preserve-order-in-strategic-merge-patch.md

Migration Notes

If your application uses the podTemplate to inject init container(s), be aware that they'll run after the bootstrap and fetch containers. This means that the /share volume will be present, and your program code will have been downloaded, before your init container runs.

Related issues (optional)

Closes #774

@EronWright EronWright requested a review from blampe May 21, 2025 20:11
@EronWright EronWright changed the title Control the ordering of initContainers Stabilize the ordering of initContainers May 21, 2025
Copy link

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 57.89474% with 16 lines in your changes missing coverage. Please review.

Project coverage is 53.19%. Comparing base (f42d305) to head (71d3a9a).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
operator/internal/controller/auto/utils.go 42.85% 8 Missing and 4 partials ⚠️
...r/internal/controller/auto/workspace_controller.go 76.47% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #923      +/-   ##
==========================================
+ Coverage   52.17%   53.19%   +1.02%     
==========================================
  Files          33       33              
  Lines        4556     4600      +44     
==========================================
+ Hits         2377     2447      +70     
+ Misses       1986     1960      -26     
  Partials      193      193              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@EronWright EronWright enabled auto-merge (squash) May 21, 2025 20:28
@EronWright EronWright requested a review from a team May 21, 2025 20:30
@EronWright EronWright disabled auto-merge May 21, 2025 22:09
@EronWright EronWright enabled auto-merge (squash) May 21, 2025 23:58
@EronWright EronWright merged commit 11be85b into master May 22, 2025
9 checks passed
@EronWright EronWright deleted the issue-774 branch May 22, 2025 00:07
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v2.1.0.

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.

Use a podTemplate inside the workspaceTemplate
3 participants