Do not use default as namespace for KAR templates if not supplied #1361
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.
Signed-off-by: hasheddan georgedanielmangum@gmail.com
Description of your changes
This changes the behavior of the
KubernetesApplicationResource
controller to not automatically assume the resources that do not have anamespace
defined should be created in thedefault
namespace. This was causing issues because we updated the patch logic in this controller to actually update the remote resources, but the change caused errors when patchingNamespace
resources that had no namespace supplied (as is customary).A few summarizing notes:
Namespace
is included in a template without having thenamespace
field defined, it will be able to be created and patched successfullyNamespace
is included in a template and does have thenamespace
field defined, it will be created but will fail to be patched (this is probably the most surprising behavior)Namespace
(like aCustomResourceDefinition
) is included in a template with or without having thenamespace
field defined, it will be able to be created and patched successfullyService
) is included in a template without having thenamespace
field defined, it will fail to be createdService
) is included in a template without having thenamespace
field defined, it will fail to be createdHow has this code been tested?
I created various renditions of the scenarios listed above. One such config, labeled with success / error for each template is included below:
Config:
Checklist
I have:
make reviewable
to ensure this PR is ready for review.appropriate.
For more about what we believe makes a pull request complete, see our
definition of done.