Skip to content

add objectSelector to the new controller webhooks #3165

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

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

kishorj
Copy link
Collaborator

@kishorj kishorj commented Apr 20, 2023

Issue

Fluxcd users reported issues installing/upgrading the controller chart version 1.5.1 due to vingressclassparams.elbv2.k8s.aws webhook errors.

Description

The service mutator and ingressclassparams validator webhooks ignore the services and the ingressclassparams resources included in the controller manifest.

The webhook service is of type ClusterIP and need not be mutated by the webhook. This change resolves the cyclic dependency between the service and the mutator webhook. In the long term we will use the matchConditions once AdmissionWebhookMatchConditions feature is GA.

As for the vingressclassparams.elbv2.k8s.aws, ignoring the ingressclassparams resource included in the chart allows the install/upgrade to succeed. This is a short term fix to get backward compatible behavior, we will deprecate the default ingressclassparams resource included in the chart in future releases.

Tests

  • successfully ran flux create helmrelease for chart version 1.5.2, no prior installation
  • started with chart 1.4.8 and upgraded to 1.5.2 without errors

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

The service mutator and ingressclassparams validator webhooks
ignore the services and the ingressclassparams resources included
in the controller manifest.

The webhook service is of type ClusterIP and need not be mutated
by the webhook. This change resolves the cyclic dependency between
the service and the mutator webhook. In the long term we will use
the `matchConditions` once `AdmissionWebhookMatchConditions` feature
is GA.

As for the `ingressclassparams`, the webhook might not be available
during chart install/upgrade time causing the operation to fail. This
is a short term fix to get backward compatible behavior.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 20, 2023
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 20, 2023
@kishorj kishorj added tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 20, 2023
@kishorj kishorj changed the title add objectSelector to the v2.5 controller webhooks add objectSelector to the new controller webhooks Apr 20, 2023
@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (06abaed) 54.73% compared to head (5e44f5f) 54.73%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3165   +/-   ##
=======================================
  Coverage   54.73%   54.73%           
=======================================
  Files         145      145           
  Lines        8479     8479           
=======================================
  Hits         4641     4641           
  Misses       3503     3503           
  Partials      335      335           

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.

Copy link
Collaborator

@M00nF1sh M00nF1sh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 20, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kishorj, M00nF1sh

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 20, 2023
@k8s-ci-robot k8s-ci-robot merged commit 4cf7c33 into kubernetes-sigs:main Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants