fix: include validation for forbidden namespaces#32
fix: include validation for forbidden namespaces#32tekton-robot merged 1 commit intotektoncd:mainfrom
Conversation
|
@anithapriyanatarajan: The label(s) 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/test-infra repository. |
cfc48cc to
6a519f7
Compare
|
/retest |
45cf987 to
f8dfe4f
Compare
|
/lgtm |
Signed-off-by: Anitha Natarajan <anataraj@redhat.com>
a63c243 to
d7526f2
Compare
|
There's a contradiction between the webhook configuration and validation code. This means the validation logic never executes because the webhook is never called. Let's remove |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: infernus01 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 |
|
/lgtm |
Changes
This pull request introduces a new validation to prevent namespace-level configuration from being created in certain forbidden namespaces, specifically those prefixed with
kube-,openshift-, ortekton-. The changes include the implementation of the validation logic, updates to the admission webhook, and tests to ensure correct enforcement.validateNamespaceForConfiginpkg/webhook/configmapvalidation.gothat checks if a namespace starts withkube-,openshift-, ortekton-and returns an error if so. This prevents creation of namespace-level configs in these forbidden namespaces.Admitmethod inValidateConfigMapto invokevalidateNamespaceForConfigfor namespace-level configs and reject requests in forbidden namespaces, returning a detailed error response.Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes
/kind fix