Merged
Conversation
In nAuth there are several places where we accept an empty namespace and where we then default to e.g. operator-, account- or other CR namespace. This is error-prone due to the risk of passing around "" namespace too deep before it's noticed. Introducing a domain model for dealing with validated Namespace and NamespacedName enabling stricter interfaces and the ability to fail faster with clear expectations. Signed-off-by: Thobias Karlsson <thobias.karlsson@gmail.com>
kejne
approved these changes
Mar 13, 2026
henriropp
reviewed
Mar 13, 2026
henriropp
approved these changes
Mar 13, 2026
Contributor
henriropp
left a comment
There was a problem hiding this comment.
Looks good. Just thinking if the Namespace needs to have a type, is it only used in the main? validate once and done, or do we foresee more Namespace usage, that is not NamespacedName?
Collaborator
Author
It's not just in main, that would have been overkill I agree. It's also used when searching for secrets by namespace and labels and when looking up clusters. |
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.
In nAuth there are several places where we accept an empty namespace and where we then default to e.g. operator-, account- or other CR namespace. This is error-prone due to the risk of passing around "" namespace too deep before it's noticed. Introducing a domain model for dealing with validated Namespace and NamespacedName enabling stricter interfaces and the ability to fail faster with clear expectations.