Add namespace validation to catch invalid names before build/deploy#3133
Add namespace validation to catch invalid names before build/deploy#3133knative-prow[bot] merged 7 commits intoknative:mainfrom
Conversation
|
Hi @RayyanSeliya. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3133 +/- ##
==========================================
+ Coverage 62.37% 63.10% +0.73%
==========================================
Files 150 150
Lines 13501 13519 +18
==========================================
+ Hits 8421 8531 +110
+ Misses 4103 3981 -122
- Partials 977 1007 +30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey @gauron99 can u have alook when u have some moments am I doing right ? |
3a6126d to
bf14a13
Compare
|
same here as with my other comment on different PR. I think we could put the WDYT @lkingland ? |
| // ValidateNamespace validates that the input name is a valid Kubernetes namespace name, ie. valid DNS-1035 label. | ||
| // It must consist of lower case alphanumeric characters or '-', | ||
| // start with an alphabetic character, and end with an alphanumeric character | ||
| // (e.g. 'my-namespace', 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?') |
There was a problem hiding this comment.
I would like it if there could be a link in the comment to the k8s docs so the source is easily accessible for what the limits here are.
There was a problem hiding this comment.
@matejvasek @lkingland anything you can think of we are missing here for the namespace rules? or any other labels?
|
Hey @gauron99 should I wait for luke and other member for opinion or should I implement as you have described ? |
fc450f0 to
9cdeda1
Compare
|
same here some of the test are failing @lkingland @gauron99 dont know why ! |
|
/override "On Cluster RT Test (ubuntu-latest, pack)" "E2E Test (ubuntu-latest, springboot)" |
|
@gauron99: Overrode contexts on behalf of gauron99: E2E Test (ubuntu-latest, springboot), On Cluster RT Test (ubuntu-latest, pack) DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: RayyanSeliya <rayyanseliya786@gmail.com>
Signed-off-by: RayyanSeliya <rayyanseliya786@gmail.com>
Signed-off-by: RayyanSeliya <rayyanseliya786@gmail.com>
Signed-off-by: RayyanSeliya <rayyanseliya786@gmail.com>
Signed-off-by: RayyanSeliya <rayyanseliya786@gmail.com>
Signed-off-by: RayyanSeliya <rayyanseliya786@gmail.com>
Signed-off-by: RayyanSeliya <rayyanseliya786@gmail.com>
9cdeda1 to
a8a0ec9
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gauron99, lkingland, RayyanSeliya The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Adds DNS-1123 validation for namespace names before build/deploy operations. Invalid namespace names now fail immediately with clear error messages instead of proceeding through lengthy builds.
Implementation:
ValidateNamespace()function using Kubernetes DNS-1123 validation (pkg/utils/names.go)deployConfig.Validate()and error handling inrunDeploy()(cmd/deploy.go)ErrInvalidNamespaceerror type (pkg/functions/errors.go) with user-friendly CLI message/kind enhancement
Fixes #3132
Release Note