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

feat: defaults handler for ingress, pods and pvcs #678

Merged
merged 8 commits into from
Jan 14, 2023
Merged

Conversation

oliverbaehler
Copy link
Collaborator

This Pull Request implements #610

Required some code refactoring to keep code as clean as possible.

Here's some notes for the review:

  • The assumption is always, that if a value for Default is defined, it's automatically allowed within a tenant. The default value does not have to be explicit allowed (Better User-Experience).
  • Patches are only mutated for Ingress. PVCs and Pods can not be patched on the relevant fields, which would cause a default mutation.
  • IngressClass only supported on API networking/v1. Feature supported for Ingress on networking v1 and v1beta1
  • StorageClass only supported on API storage/v1
  • PriorityClass only supported on API schedule/v1

@netlify
Copy link

netlify bot commented Jan 5, 2023

Deploy Preview for capsule-documentation ready!

Name Link
🔨 Latest commit c87dc2a
🔍 Latest deploy log https://app.netlify.com/sites/capsule-documentation/deploys/63c1b9cbfffa8800083a13ac
😎 Deploy Preview https://deploy-preview-678--capsule-documentation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@prometherion
Copy link
Member

  • PVCs and Pods can not be patched on the relevant fields, which would cause a default mutation.

I'm not getting the point here: if we define a mutating webhook for these fields, we should be able to respond with a mutating response that would be executed by the API Server, as we're doing with Namespaces.

Am I missing something else?

@oliverbaehler oliverbaehler changed the title feat: defaults handler for Ingress, pods and pvcs feat: defaults handler for ingress, pods and pvcs Jan 5, 2023
api/v1beta2/tenant_types.go Outdated Show resolved Hide resolved
api/v1beta2/tenant_types.go Outdated Show resolved Hide resolved
api/v1beta2/tenant_types.go Show resolved Hide resolved
config/webhook/patch_mutating_ns_selector.yaml Outdated Show resolved Hide resolved
pkg/webhook/ingress/types.go Show resolved Hide resolved
pkg/webhook/ingress/types.go Outdated Show resolved Hide resolved
pkg/webhook/utils/resources.go Outdated Show resolved Hide resolved
pkg/webhook/utils/resources.go Outdated Show resolved Hide resolved
pkg/webhook/utils/resources.go Outdated Show resolved Hide resolved
@prometherion prometherion merged commit b58cb19 into master Jan 14, 2023
@prometherion prometherion deleted the issues/610 branch January 14, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants