Skip to content
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 1905119: dynamically update controller asset for custom CA bundle #111

Merged
merged 1 commit into from Feb 2, 2021

Conversation

staebler
Copy link
Contributor

The determination about whether a custom CA bundle is being used is assessed when the operator starts. This can lead to incorrect behavior if the kube-cloud-config ConfigMap has not yet been created in the openshit-config-managed namespace when the operator starts. Instead of only looking for the ConfigMap at start-up, these changes will have the operator looking for the ConfigMap on every reconcile and adjusting the controller deployment accordingly.

@openshift-ci-robot
Copy link
Contributor

@staebler: This pull request references Bugzilla bug 1905119, 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
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1905119: dynamically update controller asset for custom CA bundle

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.

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jan 22, 2021
@jsafrane
Copy link
Contributor

@staebler, I can see that the driver installation failed with:

Operator degraded (AWSEBSCSIDriverOperatorCR_AWSEBSDriverControllerServiceController_SyncError): AWSEBSCSIDriverOperatorCRDegraded: AWSEBSDriverControllerServiceControllerDegraded: Deployment.apps "aws-ebs-csi-driver-controller" is invalid: spec.template.spec.containers[0].volumeMounts[2].name: Not found: "ca-bundle"

pkg/operator/starter.go Outdated Show resolved Hide resolved
The determination about whether a custom CA bundle is being used
is assessed when the operator starts. This can lead to incorrect
behavior if the kube-cloud-config ConfigMap has not yet been created
in the openshit-config-managed namespace when the operator starts.
Instead of only looking for the ConfigMap at start-up, these changes
will have the operator looking for the ConfigMap on every reconcile
and adjusting the controller deployment accordingly.
@staebler
Copy link
Contributor Author

445a6de...ede9ba3

  • Fix controller.yaml to remove the leftover ca-bundle volume mount.
  • Use an informer to drive the fetch of the custom CA bundle.

Copy link
Member

@bertinatto bertinatto left a comment

Choose a reason for hiding this comment

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

Just a question, the rest LGTM

return func(_ *opv1.OperatorSpec, deployment *appsv1.Deployment) error {
switch used, err := isCustomCABundleUsed(cloudConfigLister); {
case err != nil:
return fmt.Errorf("could not determine if a custom CA bundle is in use: %w", err)
Copy link
Member

Choose a reason for hiding this comment

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

Just to confirm: returning an error here will degrade the operator. Is that what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, in my opinion that is what we want. But if you think otherwise, it won't hurt my feelings. Since we are using a lister, an error here is either (1) that the informer has been closed or (2) that there are RBAC restrictions preventing access to the ConfigMap. Both of those seem to me to warrant the operator being marked as degraded.

@bertinatto
Copy link
Member

LGTM. @jsafrane?

@jsafrane
Copy link
Contributor

jsafrane commented Feb 2, 2021

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2021
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, staebler

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 2, 2021
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 97f73eb into openshift:master Feb 2, 2021
@openshift-ci-robot
Copy link
Contributor

@staebler: All pull requests linked via external trackers have merged:

Bugzilla bug 1905119 has been moved to the MODIFIED state.

In response to this:

Bug 1905119: dynamically update controller asset for custom CA bundle

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.

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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants