fix(app): make app push idempotent using server-side apply#2904
Merged
kwiatekus merged 8 commits intoMay 12, 2026
Conversation
✅ Proposed changes verification passedThis pull request comes with up-to-date documentation and no illegal standard output usages. Find more detailed information in the |
musztardem
reviewed
May 8, 2026
musztardem
reviewed
May 8, 2026
musztardem
requested changes
May 8, 2026
Contributor
musztardem
left a comment
There was a problem hiding this comment.
I'd adjust the deployment/service building functions, otherwise LGTM
…e test coverage - Fix 1: Set Namespace field in buildDeployment's ObjectMeta so ApplyDeployment can correctly pass namespace to rootlessdynamic.Apply() - Fix 2: Set TypeMeta on deployment before ToUnstructured for consistency with CreateAPIRule pattern, instead of setting it after conversion - Fix 3: Enhance Test_ApplyDeployment to verify namespace propagation and image updates are correctly captured in applied objects
4f48de0 to
6ff5263
Compare
✅ Proposed changes verification passedThis pull request comes with up-to-date documentation and no illegal standard output usages. Find more detailed information in the |
✅ Proposed changes verification passedThis pull request comes with up-to-date documentation and no illegal standard output usages. Find more detailed information in the |
musztardem
approved these changes
May 12, 2026
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
kyma app pushpreviously failed on rerun with "already exists" errors for Deployment and ServiceApplyDeploymentandApplyServicefunctions using Server-Side Apply (SSA) via the existingrootlessdynamic.Apply()infrastructure — the same pattern already used byCreateAPIRulepush.gonow calls the newApply*functions; existingCreate*functions are preserved for backward compatibilityChanges
internal/kube/resources/deployment.go— addApplyDeploymentinternal/kube/resources/service.go— addApplyServiceinternal/cmd/app/push.go— switch toApplyDeployment/ApplyService; update output messages from "Creating" to "Applying"Test plan
go test ./internal/kube/resources/... ./internal/cmd/app/...passeskyma app push --name my-app --image <image>twice against a cluster — second run should succeed without errorsRelated to
Fixes #2905
#2899
#2410