fix: check for double definition (cherry-pick #15670)#16272
Merged
ishitasequeira merged 1 commit intorelease-2.8from Nov 9, 2023
Merged
fix: check for double definition (cherry-pick #15670)#16272ishitasequeira merged 1 commit intorelease-2.8from
ishitasequeira merged 1 commit intorelease-2.8from
Conversation
* fix: check for double definition As found in #13965 (and as a follow-up to #13999), we also need to define what happens if _both_ managedNamespaceMetadata _and_ an Application manifest are both defined for the same namespace. The idea here is that if that happens, we emit an `ApplicationConditionRepeatedResourceWarning`, and set the sync status to `Unknown`, since it's unclear what is supposed to happen. The user will then have the option of removing one of the two definitions. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * fix: check for double definition A simpler fix - don't add a managed namespace to the targetObjs list if a namespace already exists in the application source. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * test: add test cases This adds a test case showing that an ns manifest will override `managedNamespaceMetadata` without failing horribly (as it currently does on `HEAD`), as well as a "standard" mNMd diff vs live. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> --------- Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
ishitasequeira
approved these changes
Nov 9, 2023
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.
Cherry-picked fix: check for double definition (#15670)
As found in #13965 (and as a follow-up to #13999), we also need to
define what happens if both managedNamespaceMetadata and an
Application manifest are both defined for the same namespace.
The idea here is that if that happens, we emit an
ApplicationConditionRepeatedResourceWarning, and set the sync statusto
Unknown, since it's unclear what is supposed to happen.The user will then have the option of removing one of the two
definitions.
Signed-off-by: Blake Pettersson blake.pettersson@gmail.com
A simpler fix - don't add a managed namespace to the targetObjs list if
a namespace already exists in the application source.
Signed-off-by: Blake Pettersson blake.pettersson@gmail.com
This adds a test case showing that an ns manifest will override
managedNamespaceMetadatawithout failing horribly (as it currentlydoes on
HEAD), as well as a "standard" mNMd diff vs live.Signed-off-by: Blake Pettersson blake.pettersson@gmail.com
Signed-off-by: Blake Pettersson blake.pettersson@gmail.com