Skip to content
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

Add namespace webhook validation #41

Merged

Conversation

michael-valdron
Copy link
Member

Please specify the area for this PR

registry operator

What does does this PR do / why we need it:

Adds namespace validation to webhooks for devfileregistry, devfileregistries, and clusterdevfileregistrieslist to prevent deployment to the default namespace.

Which issue(s) this PR fixes:

Fixes #?

part of devfile/api#1092

PR acceptance criteria:

  • Test Coverage
    • Are your changes sufficiently tested, and are any applicable test cases added or updated to cover your changes?
  • Gosec scans

Documentation

How to test changes / Special notes to the reviewer:

@michael-valdron michael-valdron force-pushed the namespace-webhook-validation branch from d1c8083 to fd16148 Compare April 11, 2023 19:49
@openshift-ci
Copy link

openshift-ci bot commented Apr 11, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kim-tsao, michael-valdron

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@e29b302). Click here to learn what that means.
Patch coverage: 54.83% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #41   +/-   ##
=======================================
  Coverage        ?   22.72%           
=======================================
  Files           ?       23           
  Lines           ?     1307           
  Branches        ?        0           
=======================================
  Hits            ?      297           
  Misses          ?      995           
  Partials        ?       15           
Impacted Files Coverage Δ
...i/v1alpha1/clusterdevfileregistrieslist_webhook.go 71.87% <20.00%> (ø)
api/v1alpha1/devfileregistrieslist_webhook.go 72.72% <33.33%> (ø)
api/v1alpha1/devfileregistry_webhook.go 60.00% <60.00%> (ø)
api/v1alpha1/validate.go 93.87% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@michael-valdron michael-valdron merged commit d69e00a into devfile:main Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants