Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check for double definition (cherry-pick #15670) #16271

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

gcp-cherry-pick-bot[bot]
Copy link

Cherry-picked fix: check for double definition (#15670)

  • 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

* 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>
@gcp-cherry-pick-bot gcp-cherry-pick-bot bot requested a review from a team as a code owner November 8, 2023 03:04
@ishitasequeira ishitasequeira enabled auto-merge (squash) November 9, 2023 22:30
@ishitasequeira ishitasequeira merged commit 45d5de7 into release-2.9 Nov 9, 2023
15 of 21 checks passed
@ishitasequeira ishitasequeira deleted the cherry-pick-b6c0b0-release-2.9 branch November 9, 2023 22:30
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants