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
Bug 1940142: Correct incorrect CACert in secrets created prior to 4.6 #314
Bug 1940142: Correct incorrect CACert in secrets created prior to 4.6 #314
Conversation
|
@mdbooth: This pull request references Bugzilla bug 1940142, which is valid. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: 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. |
|
Skipping CI for Draft Pull Request. |
|
Please take a look at where this is going, but it is currently completely untested. I am adding unit tests for all new code. |
|
This may supercede #309 |
92e239c
to
443d6ae
Compare
|
/hold I'm just reworking the tests a bit to remove the go-test dependency |
|
/hold cancel |
This secretannotator does nothing other than validate the configuration of the OpenStack root secret. It will raise an error if the configuration is anything other than the default or explicitly 'Passthrough'.
This refactor is in preparation for subsequent patches which reuse GetRootCloudCredentialsSecretData and openstack constants from another package.
In OCP versions <4.6 we included the original host cacert path in clouds.yaml. It is wrong because internally we always use "/etc/kubernetes/static-pod-resources/configmaps/cloud-config/ca-bundle.pem". The issue was fixed in the installer [1] in 4.6 but we still have to replace incorrect values in the generated clouds.yaml for the previous versions. This commit checks if the value is not correct and fixes it in the root secret. [1] openshift/installer#4227 Co-Authored-By: Mike Fedosin <mfedosin@redhat.com>
|
/retest |
2 similar comments
|
/retest |
|
/retest |
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
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: joelddiaz, mdbooth 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 |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
5 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@mdbooth: All pull requests linked via external trackers have merged: Bugzilla bug 1940142 has been moved to the MODIFIED state. 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. |
Prior to OpenShift 4.6 the installer would create secrets with an invalid cacert which prevented them from working when validating the cert. This has been fixed in the installer for new clusters, but existing cluster may still contain these invalid credentials. We need a way to seamlessly fix these broken root credential secrets. This series fixes the problem by adding a secretannotator for OpenStack and applying the fix in its reconcile loop.
OpenStack did not previously have a secretannotator. The default behaviour of CCO on an OpenStack cluster is to run the AWS secretannotator. This is a noop on an OpenStack cluster, as the AWS root secret will not exist.
The stub secretannotator does nothing other than validate that the cluster does not specify the 'mint' mode, which is not supported by OpenStack. This is new behaviour and could potentially cause a regression if a user had specified this invalid configuration, which was previously being ignored. However, we plan to add support for all modes in the future so this code is useful, as well as conveniently following the pattern of the other cloud providers.
We add the secret validation to the reconcile loop. If we detect an invalid secret we directly update the root secret and re-reconcile.