-
Notifications
You must be signed in to change notification settings - Fork 114
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
Avoid reconciling field Webhook.ClientConfig.CABundle
#711
Conversation
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 9496671093Details
💛 - Coveralls |
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 9498846290Details
💛 - Coveralls |
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 9577793570Details
💛 - Coveralls |
Hi @zeeke, just a general comment we need to take care of this also for the cert-manager in vanilla kubernetes we will have the same issue https://github.com/k8snetworkplumbingwg/sriov-network-operator/blob/master/bindata/manifests/operator-webhook/003-webhook.yaml#L12 |
Good point. Though the unit test I implemented refers to the Openshift CA injector, the fix should be valid for the Cert Manager as well. |
pkg/apply/merge.go
Outdated
return nil | ||
} | ||
|
||
injectCABundle, ok := currentAnnotations["service.beta.openshift.io/inject-cabundle"] |
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.
@SchSeba I think you refer to this. Removing
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 9626639262Details
💛 - Coveralls |
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 9626718921Details
💛 - Coveralls |
pkg/apply/merge.go
Outdated
@@ -116,6 +122,92 @@ func MergeServiceAccountForUpdate(current, updated *uns.Unstructured) error { | |||
return nil | |||
} | |||
|
|||
// MergeWebhookForUpdate ensures the Webhook.ClientConfig.CABundle is never removed from a webhook | |||
// if the resource has the `service.beta.openshift.io/inject-cabundle` annotation |
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.
nit: please remove this one
Thanks for your PR,
To skip the vendors CIs use one of:
|
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 9658912326Details
💛 - Coveralls |
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 9675205060Details
💛 - Coveralls |
Webhook resources (`ValidatingWebhookConfiguration` and `MutatingWebhookConfiguration`) in OpenShift are configured with `service.beta.openshift.io/inject-cabundle` in a way that a third component fills the ClientConfig.CABundle field of the webhook. When reconciling webhooks, do not override the field and avoid a flakiness, as there might be a time slot in which the API server is not configured with a valid client certificate: ``` Error from server (InternalError): error when creating "policies": Internal error occurred: failed calling webhook "operator-webhook.sriovnetwork.openshift.io": failed to call webhook: Post "https://operator-webhook-service.openshift-sriov-network-operator.svc:443/mutating-custom-resource?timeout=10s": tls: failed to verify certificate: x509: certificate signed by unknown authority ``` The same behavior also happens when using CertManager Refs: - https://docs.openshift.com/container-platform/4.15/security/certificates/service-serving-certificate.html - https://issues.redhat.com/browse/OCPBUGS-32139 - https://cert-manager.io/docs/concepts/ca-injector/ Signed-off-by: Andrea Panattoni <[email protected]>
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 9676241549Details
💛 - Coveralls |
3 approvals merging |
Webhook resources (
ValidatingWebhookConfiguration
andMutatingWebhookConfiguration
) in OpenShift are configured withservice.beta.openshift.io/inject-cabundle
in a way that a third component fills the ClientConfig.CABundle field of the webhook. When reconciling webhooks, do not override the field and avoid a flakiness, as there might be a time slot in which the API server is not configured with a valid client certificate:Refs: