fix: workflow deploy nil svc error#4797
Open
Cynthia-0203 wants to merge 5 commits into
Open
Conversation
Signed-off-by: Cynthia <chenchen@koderover.com>
… auto mode Signed-off-by: Cynthia <chenchen@koderover.com>
Signed-off-by: Cynthia <chenchen@koderover.com>
Signed-off-by: Cynthia <chenchen@koderover.com>
Signed-off-by: Cynthia <chenchen@koderover.com>
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.
What this PR does / Why we need it:
Fixes a panic when creating a workflow task for Helm services with values auto-sync enabled, where the selected service has not been deployed to the target environment yet.
Previously, the deploy job assumed the service already existed in the environment and accessed its render data directly during auto-sync. For first-time deployments, the environment service does not exist yet, causing a nil pointer panic and a 500 response.
This PR allows first-time Helm service deployments to proceed with the submitted values, while preserving source metadata after deployment so future auto-sync runs can fetch the latest values correctly.
What is changed and how it works?
If the service is not deployed yet, sync the latest values from the template service's helm source so the deploy is not driven by empty/stale user input. A new ValuesSyncedFromSource flag on JobTaskHelmDeploySpec records that the values came from source. At deploy time, for a newly deployed service whose values were synced from source, the new render's AutoSyncYaml is seeded with the pure source values so future auto-sync runs compare against a clean baseline. If the template service has no source configured, it falls back to the submitted values — no regression.
Does this PR introduce a user-facing change?
This change is