-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set Upgradeable=False if default cert has no SAN
If an ingresscontroller's default certificate has a Common Name (CN)) but has no Subject Alternative Name (SAN) for the ingress domain, report that the cluster cannot be upgraded by setting the Upgradeable=False status condition on the ingresscontroller and clusteroperator. Clients built using Go 1.17 reject certificates without SANs. OpenShift 4.10 is built using Go 1.17, which means that various operators that connect to routes that use the default certificate would reject the certificate and fail to complete the TLS handshake after upgrading to OpenShift 4.10 if the ingress operator didn't block the upgrade on a cluster with a problematic certificate. The commit is related to bug 2057762. https://bugzilla.redhat.com/show_bug.cgi?id=2057762 * pkg/operator/controller/ingress/status.go (syncIngressControllerStatus): Get the default certificate secret and pass it to computeIngressUpgradeableCondition. (computeIngressUpgradeableCondition): Add a parameter for the default certificate secret. Use the argument value to call the new checkDefaultCertificate function to check for problematic certificates. (checkDefaultCertificate): New function. Return a non-nil error value if the default certificate in the provided secret has a CN for the ingress domain and no SAN for the same. * pkg/operator/controller/ingress/status_test.go (TestComputeIngressUpgradeableCondition): Verify that computeIngressUpgradeableCondition reports Upgradeable=False if the default certificate has a CN and no SAN for the ingress domain and reports Upgradeable=True otherwise.
- Loading branch information
Showing
2 changed files
with
111 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters