-
Notifications
You must be signed in to change notification settings - Fork 4
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
[DPE-3247] Add creation of non-existing namespace #96
base: main
Are you sure you want to change the base?
Conversation
logger.warn( | ||
f"Namespace {namespace} does not exist, and it could not be created." | ||
) | ||
raise NamespaceNotFound(namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: In my opinion this class name doesn't truly describe that the namespace could not be created (which is the case because Exception
catches everything that is thrown during the creation of namespace).
logger.warn( | ||
f"Namespace {namespace} does not exist, and it could not be created." | ||
) | ||
raise NamespaceNotFound(namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I believe we haven't caught NamespaceNotFound
yet in main
. Therefore, the raise
here will possibly pass through the except Exception
block in main
from where it will be raise
d again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On this regard, it'd be awesome if we could add an integration test for this scenario (where the SA that is creating the namespace doesn't have enough permissions). However I'm not sure if there's a way to do that without involving pods and all complexities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the point raised by @theoctober19th . It would be good to have the restricted permission tests, to make sure we have proper error handling
This PR adds the capability of the spark8t lib to create the namespace if it does not exist.