-
Notifications
You must be signed in to change notification settings - Fork 11
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
fail if the provided user name is not k8s compliant #94
base: master
Are you sure you want to change the base?
fail if the provided user name is not k8s compliant #94
Conversation
it's much simpler and much better than sanitizing the username, indeed! |
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.
Thanks for implementing this check 🙏
I have few minor questions/clarifications.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #94 +/- ##
==========================================
+ Coverage 67.78% 68.02% +0.23%
==========================================
Files 44 44
Lines 3216 3240 +24
==========================================
+ Hits 2180 2204 +24
Misses 841 841
Partials 195 195
|
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.
Great job!
Thanks for answering my questions 🙏
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.
Thanks for the fix!
err := ensureUsers(clusterCtx, objectsCache{}) | ||
|
||
// then | ||
require.Error(t, err) |
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 usually prefer checking the actual error just to make sure the error message is informative and it's actually the expected error and not something else. Unless it's tricky to hardcode the expected error message in the test.
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.
+1 to checking the actual error
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.
see #94 (comment)
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.
Thanks for this, i liked this approach
we should fail if the provided name of the user is not compliant with k8s names and label values.