fix: merge LaunchPlan security context per field on registration#3442
Open
1fanwang wants to merge 1 commit into
Open
fix: merge LaunchPlan security context per field on registration#34421fanwang wants to merge 1 commit into
1fanwang wants to merge 1 commit into
Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.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.
Why are the changes needed?
Registering a launch plan that declares
secrets(ortokens) while passing registrationOptionsthat only set a service account silently drops the secrets.get_serializable_launch_plandoesoptions.security_context or entity.security_context— a wholesale replace — so any non-empty options context wipes whatever the launch plan authored.What changes were proposed in this pull request?
Merge the two security contexts per field instead of replacing wholesale: options win field-by-field (
run_as,secrets,tokens), so a service-account-only override stops clobbering authored secrets.How was this patch tested?
test_get_serializable_launch_plandrives the same path. Also end-to-end against a real flyteadmin (flyte demo): register the secrets launch plan with service-account-only options and read it back — before,secretsreturnsNone(dropped); after, it's preserved alongside the overridden service account.Check all the applicable boxes