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

Fix webhook generator to include matchPolicy of 'Exact' #5437

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

naemono
Copy link
Contributor

@naemono naemono commented Mar 4, 2022

Fixes #5423

This change includes matchPolicy: Exact in the OLM webhook generator such that v1beta1 webhooks will not try to validate v1 resources.

Test generated webhook

  webhookdefinitions:
    - admissionReviewVersions:
      - v1beta1
      containerPort: 443
      deploymentName: elastic-operator
      failurePolicy: Ignore
      generateName: elastic-agent-validation-v1alpha1.k8s.elastic.co
      matchPolicy: Exact
      rules:
      - apiGroups:
        - agent.k8s.elastic.co
        apiVersions:
        - v1alpha1
        operations:
        - CREATE
        - UPDATE
        resources:
        - agents
      sideEffects: None
      targetPort: 9443
      type: ValidatingAdmissionWebhook
      webhookPath: /validate-agent-k8s-elastic-co-v1alpha1-agent

@naemono naemono added >bug Something isn't working v2.1.0 labels Mar 4, 2022
@naemono naemono requested a review from pebrc March 4, 2022 14:45
Copy link
Collaborator

@pebrc pebrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@naemono naemono merged commit ed740dd into elastic:main Mar 4, 2022
@naemono naemono deleted the 5423-fix-olm-webhook-generator branch March 4, 2022 18:18
naemono added a commit to naemono/cloud-on-k8s that referenced this pull request Mar 7, 2022
fantapsody pushed a commit to fantapsody/cloud-on-k8s that referenced this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OLM generator code does not set matchPolicy in webhook definitions
2 participants