Add version annotation to APIService to prevent race conditions during rolling upgrades#1813
Open
mdzhigarov wants to merge 1 commit intocarvel-dev:developfrom
Open
Conversation
eb9e40c to
66d8ad5
Compare
…g rolling upgrades During kapp-controller rolling upgrades via `kapp deploy`, a race condition can occur where kapp reports success even though the APIService webhook is not ready yet. This happens because kapp doesn't detect any changes in the APIService resource and considers the deployment complete before the new APIService is fully operational. This change adds a version annotation to the APIService that gets updated with each release, ensuring kapp detects changes and properly waits for the APIService to be ready during rolling upgrades. Changes: - Add kapp-controller.carvel.dev/version annotation to APIService metadata - Update build script to replace version placeholder with actual release version - Follow same pattern as existing Deployment resource versioning Fixes race condition during kapp-controller upgrades where APIService readiness is not properly validated. Signed-off-by: Marin Dzhigarov <m.dzhigarov@gmail.com> Made-with: Cursor
66d8ad5 to
020a89e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a version annotation to the APIService resource to prevent race conditions during kapp-controller rolling upgrades.
Problem
During kapp-controller rolling upgrades via
kapp deploy <KC-new-release.yml>, a race condition occurs where:Solution
Add a version annotation (
kapp-controller.carvel.dev/version) to the APIService that:Changes
kapp-controller.carvel.dev/version: v0.0.0annotation to APIService metadataImplementation Details
This follows the exact same pattern already used for the Deployment resource:
v0.0.0placeholder in source filesTest Plan
Impact
Fixes race condition during kapp-controller rolling upgrades where APIService readiness validation was bypassed.
Made with Cursor