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: allow existing namespaces to be used #49

Conversation

blakepettersson
Copy link
Contributor

@blakepettersson blakepettersson commented Aug 21, 2024

Description of your changes

There are some use cases where we'd want to use an existing namespace. Without this patch, we can get a client-side conflict. If the namespace already exists, just add the label metadata to the namespace and don't touch anything else. For any other resource we should keep the existing behavior.

How has this code been tested

With a cluster that has a pre-existing namespace.

There are some use cases where we'd want to use an existing namespace.
Without this patch, we can get a client-side conflict. If the namespace
already exists, just add the label metadata to the namespace and don't
touch anything else. For any other resource we should keep the existing
behavior.

Signed-off-by: Blake Pettersson <[email protected]>
}

// Object already exists, just patch the namespace metadata.
metadata := applyObject.unstructuredObj["metadata"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a logger.info for this case to be able to identify this in "normal" logs?

Signed-off-by: Blake Pettersson <[email protected]>
@jiachengxu jiachengxu merged commit f2824a3 into akuity:main Aug 21, 2024
5 checks passed
@blakepettersson blakepettersson deleted the fix/allow-existing-namespaces-to-be-used branch August 27, 2024 09:54
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.

3 participants