-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cleanup: Scope mutating webhook to only certificaterequest resources #6311
cleanup: Scope mutating webhook to only certificaterequest resources #6311
Conversation
Signed-off-by: Peter Fiddes <peter.fiddes@gmail.com>
Hi @hawksight. Thanks for your PR. I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Signed-off-by: Peter Fiddes <peter.fiddes@gmail.com>
I should add here that I will look through again at the cert-manager code around webhooks. The only reason to catch all cert-manager / acme resources would be to convert the API version. I think in previous discussions we don't do that anymore as everyone should not be on |
/ok-to-test |
1 similar comment
/ok-to-test |
/kind cleanup |
@hawksight I think the conversion webhooks are not relevant here if that's what you mean. They are configured on the CRDs. |
I was thinking that perhaps the use of But are we confident that cert-manager only converts CRDs themselves and not instances of |
Any conversion webhooks should be defined on the CRD (but apply to the resources of that kind). See here for reference: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#configure-customresourcedefinition-to-use-conversion-webhooks. And I don't think we have any conversion webhooks defined in cert-manager at present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm (which I should not be eligible for in this project)
/lgtm |
@erikgb: adding LGTM is restricted to approvers and reviewers in OWNERS files. In 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. |
@munnerz - talking with @SgtCoDFish this morning he suggested you might have a good understanding in the area of cert-manager's mutating webhooks. Might you be able to take a look at this relatively small change please? I'm mostly checking there is no unintended consequences from reducing the scope of the mutating webhook here. |
apiVersions: | ||
- "v1" | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- "*/*" | ||
- "certificaterequests" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing to note: this does mean we won't mutate any subresource requests for certificaterequests anymore. I think this is totally fine - the only time we need to inspect requests to certificaterequests/status
is in the approval
admission plugin: https://github.com/cert-manager/cert-manager/blob/master/internal/plugin/admission/certificaterequest/approval/certificaterequest_approval.go
This is a validating plugin only however, not mutating, so this is fine 👍
This LGTM and I think is quite a big win overall - thanks for doing this investigation! I am a little concerned that some clients may have come to rely on this value being default to Looking at our defaulting functions registered with our scheme (which get applied at the point the webhook decodes the json object), they are empty across all API groups too: https://github.com/cert-manager/cert-manager/blob/master/internal/apis/certmanager/v1/defaults.go You can also see what kind of admission plugins we actually have by looking here: https://github.com/cert-manager/cert-manager/tree/master/internal/plugin/admission - as noted above, only one of these is mutating and it only applies on 'create' operations :) I think we could probably also go a step further and remove the mutating webhook for UPDATE operations specifically too (though we do still need the validating webhook for updates, to prevent people changing the userInfo fields). Our tests are passing here, and we don't require mutation for any other resource types... /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: erikgb, munnerz 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 |
deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: Peter Fiddes <peter.fiddes@gmail.com>
Thank you @munnerz for looking over that. I've removed the The links where particularly helpful for my understanding. |
Awesome, looks great! 🚀 /lgtm |
Sounds like everyone is broadly in favour here :) let's see how this goes 🚀 /hold cancel |
Adding some documentation here as to other potential workarounds to the problem if you happen to be running cert-manager v1.14.x and are unable to upgrade. Extract from notesIf you are running a cert-manager installation prior to v1.14.x you should first consider upgrading.
Option one seems to work but generally should be avoided as order cannot be counted on. Mutating webhooks should also be idempotent. Option two is recommended, as this is the fix that is implemented in later versions of cert-manager, based on this PR #6311. To manually patch the webhook we have a YAML patch resource: webhooks:
- name: webhook.cert-manager.io
namespaceSelector: {}
objectSelector: {}
reinvocationPolicy: Never
rules:
- apiGroups:
- cert-manager.io
apiVersions:
- v1
operations:
- CREATE
resources:
- 'certificaterequests'
scope: '*' To validate exactly what this patch will do, simply run the following to see a kubectl patch mutatingwebhookconfigurations.admissionregistration.k8s.io cert-manager-webhook --patch-file patches/mutatingwebhookconfiguration-patch.yaml --dry-run=server -o yaml | kubectl diff -f - And to apply the patch so it takes effect: kubectl patch mutatingwebhookconfigurations.admissionregistration.k8s.io cert-manager-webhook --patch-file patches/mutatingwebhookconfiguration-patch.yaml |
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [cert-manager](https://github.com/cert-manager/cert-manager) | minor | `v1.13.3` -> `v1.14.1` | --- ### Release Notes <details> <summary>cert-manager/cert-manager (cert-manager)</summary> ### [`v1.14.1`](https://github.com/cert-manager/cert-manager/releases/tag/v1.14.1) [Compare Source](cert-manager/cert-manager@v1.14.0...v1.14.1) cert-manager is the easiest way to automatically manage certificates in Kubernetes and OpenShift clusters. cert-manager 1.14 brings a variety of features, security improvements and bug fixes, including: support for creating X.509 certificates with "Other Name" fields, and support for creating CA certificates with "Name Constraints" and "Authority Information Accessors" extensions. > 📢 cert-manager `v1.14.1` fixes bugs found *during* the release of `v1.14.0`. > > When upgrading to cert-manager release 1.14, please skip `v1.14.0` and install this patch version instead. ##### Documentation - [Release notes](https://cert-manager.io/docs/releases/release-notes/release-notes-1.14) - [Upgrade notes](https://cert-manager.io/docs/releases/upgrading/upgrading-1.13-1.14) - [Installation instructions](https://cert-manager.io/docs/installation/) ##### Changes since `v1.14.0` ##### Bug or Regression - Fix broken cainjector image value in Helm chart ([#​6693](cert-manager/cert-manager#6693), [@​SgtCoDFish](https://github.com/SgtCoDFish)) - Fix bug in cmctl namespace detection which prevented it being used as a startupapicheck image in namespaces other than cert-manager. ([#​6706](cert-manager/cert-manager#6706), [@​inteon](https://github.com/inteon)) - Fix bug in cmctl which caused `cmctl experimental install` to panic. ([#​6706](cert-manager/cert-manager#6706), [@​inteon](https://github.com/inteon)) ### [`v1.14.0`](https://github.com/cert-manager/cert-manager/releases/tag/v1.14.0) [Compare Source](cert-manager/cert-manager@v1.13.3...v1.14.0) cert-manager is the easiest way to automatically manage certificates in Kubernetes and OpenShift clusters. cert-manager 1.14 brings a variety of features, security improvements and bug fixes, including: support for creating X.509 certificates with "Other Name" fields, and support for creating CA certificates with "Name Constraints" and "Authority Information Accessors" extensions. >⚠️ This version has known issues. Please install `v1.14.1` instead. > > During the release of `v1.14.0`, the Helm chart was found to use the wrong OCI image for the `cainjector` Deployment, > which caused the Helm installation and the static manifest based installation to fail. > Upon discovery of this bug, the release of `v1.14.0` was paused before the Helm chart or GitHub release were published; > but the Git tag and the OCI images had already been published. > > The cert-manager team next fixed the Helm chart and two other bugs which are listed in the "Known Issues" section below, > and then released `v1.14.1`, which is the version that users are strongly advised to install when they upgrade to 1.14. > > In order to complete the stalled `v1.14.0` release, > the Helm chart and static YAML installation files were regenerated on a team member's laptop, > using exactly the same build scripts as are used in the automated release process, > and using the `v1.14.1` version of the code. > The working `v1.14.0` Helm chart was published, > and the working versions of the static manifest files attached to the draft `v1.14.0` GitHub release, > and that was then published. > > For these reasons, users are strongly advised to skip this version and install the `v1.14.1` Helm chart instead. ##### Known Issues - During the release of `v1.14.0`, the Helm chart for this version was found to use the wrong OCI image for the `cainjector` Deployment, which caused the Helm installation to fail. In order to complete the release, the cert-manager team have manually updated the Helm chart for this version, which contains all the Helm chart fixes which are in `v1.14.1`. But users are strongly advised to skip this version and install the `v1.14.1` Helm chart instead. - A bug in cmctl namespace detection prevents it being used as a `startupapicheck` image in namespaces other than cert-manager. - A bug in cmctl causes `cmctl experimental install` to panic. ##### Breaking Changes The startupapicheck job uses a new OCI image called "startupapicheck", instead of the ctl image. If you run in an environment in which images cannot be pulled, be sure to include the new image. The KeyUsage and BasicConstraints extensions will now be encoded as critical in the CertificateRequest's CSR blob. ##### Major Themes ##### New X.509 Features The cert-manager Certificate resource now allows you to configure a subset of "Other Name" SANs, which are described in the [Subject Alternative Name section of RFC 5280](https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.6) (on page 37). We specifically support any `otherName` type with a `UTF-8` value, such as the [User Principal Name](https://docs.venafi.com/Docs/current/TopNav/Content/Certificates/r-UEP-support-SANs.php) or [`sAMAccountName`](https://learn.microsoft.com/en-us/windows/win32/ad/naming-properties). These are useful when issuing unique certificates for authenticating with LDAP systems such as Microsoft Active Directory. For example you can create certificates with this block in the spec: otherNames: - oid: 1.3.6.1.4.1.311.20.2.3 # UPN OID utf8Value: upn@domain.local The feature is still in alpha stage and requires you to [enable the `OtherName` feature flag in the controller and webhook components](../../installation/configuring-components.md#feature-gates). ##### New CA certificate Features You can now specify the X.509 v3 Authority Information Accessors extension, with URLs for certificates issued by the CA issuer. Users can now use name constraints in CA certificates. To know more details on name constraints check out RFC section https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10 ##### Security An ongoing security audit of the cert-manager code revealed some weaknesses which we have addressed in this release, such as using more secure default settings in the HTTP servers that serve metrics, healthz and pprof endpoints. This will help mitigate denial-of-service attacks against those important services. All the cert-manager containers are now configured with read only root file system by default, to prevent unexpected changes to the file system of the OCI image. And it is now possible to configure the metrics server to use HTTPS rather than HTTP, so that clients can verify the identity of the metrics server. ##### Other The liveness probe of the cert-manager controller Pod is now enabled by default. There is a new option `.spec.keystores.pkcs12.algorithms` to specify encryption and MAC algorithms for PKCS. ##### Community Thanks again to all open-source contributors with commits in this release, including: - [@​ABWassim](https://github.com/ABWassim) - [@​JoeNorth](https://github.com/JoeNorth) - [@​allenmunC1](https://github.com/allenmunC1) - [@​asapekia](https://github.com/asapekia) - [@​jeremycampbell](https://github.com/jeremycampbell) - [@​jkroepke](https://github.com/jkroepke) - [@​jsoref](https://github.com/jsoref) - [@​lauraseidler](https://github.com/lauraseidler) - [@​pevidex](https://github.com/pevidex) - [@​phillebaba](https://github.com/phillebaba) - [@​snorwin](https://github.com/snorwin) - [@​tanujd11](https://github.com/tanujd11) - [@​tberreis](https://github.com/tberreis) - [@​vinny](https://github.com/vinny) Thanks also to the following cert-manager maintainers for their contributions during this release: - [@​SgtCoDFish](https://github.com/SgtCoDFish) - [@​SpectralHiss](https://github.com/SpectralHiss) - [@​ThatsMrTalbot](https://github.com/ThatsMrTalbot) - [@​hawksight](https://github.com/hawksight) - [@​inteon](https://github.com/inteon) - [@​maelvls](https://github.com/maelvls) - [@​wallrj](https://github.com/wallrj) Equally thanks to everyone who provided feedback, helped users and raised issues on GitHub and Slack and joined our meetings! Thanks also to the [CNCF](https://www.cncf.io/), which provides resources and support, and to the AWS open source team for being good community members and for their maintenance of the [PrivateCA Issuer](https://github.com/cert-manager/aws-privateca-issuer). In addition, massive thanks to [Venafi](https://www.venafi.com/) for contributing developer time and resources towards the continued maintenance of cert-manager projects. ##### Changes ##### Feature - ACME challenge solver Pod for HTTP01 will get a default annotation of `"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"`. You can provide an annotation of `"cluster-autoscaler.kubernetes.io/safe-to-evict": "false"` in your `podTemplate` if you don't like this. ([#​6349](cert-manager/cert-manager#6349), [@​jsoref](https://github.com/jsoref)) - Added a clock skew detector liveness probe that will force a restart in case we detect a skew between the internal monotonic clock and the system clock of more than 5 minutes. Also, the controller's liveness probe is now enabled by default. ([#​6328](cert-manager/cert-manager#6328), [@​inteon](https://github.com/inteon)) - Added a new flag (--dynamic-serving-leaf-duration) that can adjust the lifetime of the dynamic leaf certificates ([#​6552](cert-manager/cert-manager#6552), [@​allenmunC1](https://github.com/allenmunC1)) - Added support for `otherName` SANS in Certificates ([#​6404](cert-manager/cert-manager#6404), [@​SpectralHiss](https://github.com/SpectralHiss)) - Added the option to specify the X.509 v3 Authority Information Accessors extension CA Issuers URLs for certificates issued by the CA issuer. ([#​6486](cert-manager/cert-manager#6486), [@​jeremycampbell](https://github.com/jeremycampbell-okta)) - Adds cert-manager's new core infrastructure initiative badge! See more details on https://www.bestpractices.dev/projects/8079 ([#​6497](cert-manager/cert-manager#6497), [@​SgtCoDFish](https://github.com/SgtCoDFish)) - All Pods are now configured with `readOnlyRootFilesystem` by default. ([#​6453](cert-manager/cert-manager#6453), [@​wallrj](https://github.com/wallrj)) - MAYBE BREAKING: The startupapicheck job is now handled by an entirely new container called "startupapicheck". This replaces the previous ctl container. If you run in an environment in which images cannot be pulled, be sure to include the new container. ([#​6549](cert-manager/cert-manager#6549), [@​SgtCoDFish](https://github.com/SgtCoDFish)) - New option `.spec.keystores.pkcs12.algorithms` to specify encryption and MAC algorithms for PKCS[#​12](cert-manager/cert-manager#12) keystores. Fixes issues [#​5957](cert-manager/cert-manager#5957) and [#​6523](cert-manager/cert-manager#6523). ([#​6548](cert-manager/cert-manager#6548), [@​snorwin](https://github.com/snorwin)) - The ACME HTTP01 solver Pod is now configured with `readOnlyRootFilesystem: true` ([#​6462](cert-manager/cert-manager#6462), [@​wallrj](https://github.com/wallrj)) - Updates the AWS SDK for Go to 1.48.7 to support Amazon EKS Pod Identity ([#​6519](cert-manager/cert-manager#6519), [@​JoeNorth](https://github.com/JoeNorth)) - Users can now use name constraints in CA certificates. To know more details on name constraints check out RFC section https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10 ([#​6500](cert-manager/cert-manager#6500), [@​tanujd11](https://github.com/tanujd11)) -⚠️ potentially breaking⚠️ : The KeyUsage and BasicConstraints extensions will now be encoded as critical in the CertificateRequest's CSR blob. ([#​6053](cert-manager/cert-manager#6053), [@​inteon](https://github.com/inteon)) - Add TLS support to the metrics endpoint through either a certificate file or through dynamically issued certificates ([#​6574](cert-manager/cert-manager#6574), [@​ThatsMrTalbot](https://github.com/ThatsMrTalbot)) - Helm Chart: allow changing the default Deployment `revisionHistoryLimit` ([#​6248](cert-manager/cert-manager#6248), [@​tberreis](https://github.com/tberreis)) - Security: Limit the size of the response body read from HTTP requests by cert-manager. ([#​6619](cert-manager/cert-manager#6619), [@​ThatsMrTalbot](https://github.com/ThatsMrTalbot)) - Support custom `spec.namespaceSelector` for webhooks ([#​6638](cert-manager/cert-manager#6638), [@​jkroepke](https://github.com/jkroepke)) ##### Bug or Regression - BUGFIX\[helm]: Fix issue where webhook feature gates were only set if controller feature gates are set. ([#​6380](cert-manager/cert-manager#6380), [@​asapekia](https://github.com/asapekia)) - Controller ConfigMap is now created only if `.Values.config` is set. ([#​6357](cert-manager/cert-manager#6357), [@​ABWassim](https://github.com/ABWassim)) - Fix runaway bug caused by multiple Certificate resources that point to the same Secret resource. ([#​6406](cert-manager/cert-manager#6406), [@​inteon](https://github.com/inteon)) - Fix(helm): templating of required value in controller and webhook ConfigMap resources ([#​6435](cert-manager/cert-manager#6435), [@​ABWassim](https://github.com/ABWassim)) - Fixed a webhook validation error message when the key algorithm was invalid. ([#​6571](cert-manager/cert-manager#6571), [@​pevidex](https://github.com/pevidex)) - Fixed error messaging when setting up vault issuer ([#​6433](cert-manager/cert-manager#6433), [@​vinny](https://github.com/vinny-sabatini)) - `GHSA-vgf6-pvf4-34rq`: The webhook server now returns HTTP error 413 (Content Too Large) for requests with body size `>= 3MiB`. This is to mitigate DoS attacks that attempt to crash the webhook process by sending large requests that exceed the available memory. The webhook server now returns HTTP error 400 (Bad Request) if the request contains an empty body. The webhook server now returns HTTP error 500 (Internal Server Error) rather than crashing, if the code panics while handling a request. ([#​6498](cert-manager/cert-manager#6498), [@​inteon](https://github.com/inteon)) - Increase the default webhook timeout to its maximum value of 30 seconds, so that the underlying timeout error message has more chance of being returned to the end user. ([#​6488](cert-manager/cert-manager#6488), [@​wallrj](https://github.com/wallrj)) - Listeners that do not support TLS on Gateway resources will now not raise `BadConfig` warnings anymore ([#​6347](cert-manager/cert-manager#6347), [@​lauraseidler](https://github.com/lauraseidler)) - Mitigate potential Slowloris attacks by setting `ReadHeaderTimeout` in all `http.Server` instances ([#​6534](cert-manager/cert-manager#6534), [@​wallrj](https://github.com/wallrj)) - The Venafi issuer now properly resets the certificate and should no longer get stuck with `WebSDK CertRequest Module Requested Certificate` or `This certificate cannot be processed while it is in an error state. Fix any errors, and then click Retry.`. ([#​6398](cert-manager/cert-manager#6398), [@​maelvls](https://github.com/maelvls)) - Update experimental install and uninstall commands to have flag parity with the rest of the CLI ([#​6562](cert-manager/cert-manager#6562), [@​ThatsMrTalbot](https://github.com/ThatsMrTalbot)) - Webhook ConfigMap if now created only if `.Values.webhook.config` is set. ([#​6360](cert-manager/cert-manager#6360), [@​ABWassim](https://github.com/ABWassim)) - BUGFIX: Ensure `otherName` SAN changes in Certificate resources trigger re-issuance. ([#​6620](cert-manager/cert-manager#6620), [@​SpectralHiss](https://github.com/SpectralHiss)) - Bugfix: Publish the `startupapicheck` image to `quay.io` ([#​6609](cert-manager/cert-manager#6609), [@​wallrj](https://github.com/wallrj)) ##### Other (Cleanup or Flake) - Cert-manager is now built with Go 1.21.5 ([#​6545](cert-manager/cert-manager#6545), [@​wallrj](https://github.com/wallrj)) - Bump Go to `1.21.3` to address `CVE-2023-39325`. Also bumps base images. ([#​6410](cert-manager/cert-manager#6410), [@​SgtCoDFish](https://github.com/SgtCoDFish)) - Bump `golang.org/x/net v0.15.0 => v0.17.0` as part of addressing `CVE-2023-44487` / `CVE-2023-39325` ([#​6427](cert-manager/cert-manager#6427), [@​SgtCoDFish](https://github.com/SgtCoDFish)) - Check code for unintended use of `crypto/md5`, a weak cryptographic primitive; using `golangci-lint` / `gosec` (G501). ([#​6581](cert-manager/cert-manager#6581), [@​wallrj](https://github.com/wallrj)) - Check code for unintended use of `crypto/sha1`, a weak cryptographic primitive; using `golangci-lint` / `gosec` (G505). ([#​6579](cert-manager/cert-manager#6579), [@​wallrj](https://github.com/wallrj)) - Check code for unintended use of weak random number generator (`math/rand` instead of `crypto/rand`); using `golangci-lint` / `gosec` (G404). ([#​6582](cert-manager/cert-manager#6582), [@​wallrj](https://github.com/wallrj)) - Cleanup: Restrict MutatingWebhookConfiguration to only CertificateRequest resources ([#​6311](cert-manager/cert-manager#6311), [@​hawksight](https://github.com/hawksight)) - Deprecated `pkg/util.RandStringRunes` and `pkg/controller/test.RandStringBytes`. Use `k8s.io/apimachinery/pkg/util/rand.String` instead. ([#​6585](cert-manager/cert-manager#6585), [@​wallrj](https://github.com/wallrj)) - Enabled verbose logging in startupapicheck by default, so that if it fails, users can know exactly what caused the failure. ([#​6495](cert-manager/cert-manager#6495), [@​wallrj](https://github.com/wallrj)) - Fix gosec G601: Implicit memory aliasing of items from a range statement ([#​6551](cert-manager/cert-manager#6551), [@​wallrj](https://github.com/wallrj)) - Fix handling of serial numbers in literal certificate subjects. Previously a serial number could be specified in `subject.serialNumber` while using a literal certificate subject. This was a mistake and has been fixed. ([#​6533](cert-manager/cert-manager#6533), [@​inteon](https://github.com/inteon)) - The end-to-end tests can now test the cert-manager Vault Issuer on an OpenShift cluster. ([#​6391](cert-manager/cert-manager#6391), [@​wallrj](https://github.com/wallrj)) - Update cert-manager's distroless base images from Debian 11 to Debian 12. This should have no practical effects on users. ([#​6583](cert-manager/cert-manager#6583), [@​inteon](https://github.com/inteon)) - Updated all code using GatewayAPI to use the now GA v1 APIs ([#​6559](cert-manager/cert-manager#6559), [@​ThatsMrTalbot](https://github.com/ThatsMrTalbot)) - Upgrade Go from 1.20.7 to 1.20.8. ([#​6369](cert-manager/cert-manager#6369), [@​inteon](https://github.com/inteon)) - Upgrade `github.com/emicklei/go-restful/v3` to `v3.11.0` because `v3.10.2` is labeled as "DO NOT USE". ([#​6366](cert-manager/cert-manager#6366), [@​inteon](https://github.com/inteon)) - Use the new generic `sets.Set` type in place of the deprecated `sets.String`. ([#​6586](cert-manager/cert-manager#6586), [@​wallrj](https://github.com/wallrj)) - cert-manager is now built with Go `v1.21.6` ([#​6628](cert-manager/cert-manager#6628), [@​SgtCoDFish](https://github.com/SgtCoDFish)) - Update the Azure SDK and remove deprecated `autorest` dependency ([#​5452](cert-manager/cert-manager#5452), [@​phillebaba](https://github.com/phillebaba)) - The cert-manager E2E tests can now be run on Kubernetes 1.29 ([#​6641](cert-manager/cert-manager#6641), [@​wallrj](https://github.com/wallrj)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNjUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE2NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Reviewed-on: https://git.home/nrdufour/home-ops/pulls/358 Co-authored-by: Renovate <renovate@ptinem.io> Co-committed-by: Renovate <renovate@ptinem.io>
Pull Request Motivation
Relating to the certificate-preset investigations we have been exploring ideas on how provide users of the
Certificate
resource without baking a new feature into cert-manager code. (See #2239 for back story).As suggested by @wallrj in a slack thread, it seems that cert-manager only uses this mutating webhook for
CertificateRequest
resources, and not for actual certificates. (NOTE this may not be true and we should absolutely validate this).The impact of this webhook was that it applied to
Certificate
resources when cert-manager does nothing useful with them at admission time. In fact as @erikgb has pointed out in slack, the required fieldsissuerRef
andsecretName
do not setomitempty
on the resources here and here.This change basically makes enables other mutating webhooks to apply a default value to the field before validation. Because now the mutating webhook does not pickup
Certificate
resources and cause the small change of setting blanks.Kind
claeanup?
Release Note