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 1898045: redeploy CSI Controller Deployment when secret changes #104

Merged
merged 2 commits into from Jan 7, 2021

Conversation

bertinatto
Copy link
Member

@bertinatto bertinatto commented Dec 8, 2020

This PR uses changes from openshift/library-go#968 to redeploy the Controller Deployment when the secret changes.

CC @openshift/storage

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 8, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 8, 2020
@bertinatto bertinatto force-pushed the add-deploy-hooks branch 2 times, most recently from fcec43c to 24d31b9 Compare December 9, 2020 13:58
@bertinatto bertinatto changed the title WIP: Add deployment hook Bug 1898045: redeploy CSI Controller Deployment when secret chagnes Dec 9, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high 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. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Dec 9, 2020
@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1898045, which is valid. The bug has been moved to the POST state. 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 ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1898045: redeploy CSI Controller Deployment when secret chagnes

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.

@bertinatto
Copy link
Member Author

/hold

openshift/library-go#968 needs to be merged first.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 9, 2020
@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1898045, which is valid.

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 1898045: redeploy CSI Controller Deployment when secret chagnes

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.

1 similar comment
@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1898045, which is valid.

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 1898045: redeploy CSI Controller Deployment when secret chagnes

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.

@bertinatto bertinatto changed the title Bug 1898045: redeploy CSI Controller Deployment when secret chagnes Bug 1898045: redeploy CSI Controller Deployment when secret changes Dec 9, 2020
@bertinatto bertinatto force-pushed the add-deploy-hooks branch 2 times, most recently from bd44b5e to b1a5e9a Compare January 6, 2021 22:42
@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1898045, which is valid.

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 1898045: redeploy CSI Controller Deployment when secret changes

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.

@bertinatto
Copy link
Member Author

/hold cancel
library-go PR has been merged.

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 6, 2021
@bertinatto
Copy link
Member Author

/assign @jsafrane


func withSecretHashAnnotation(kubeClient kubeclient.Interface, namespace, secret string) func(*appsv1.Deployment) error {
return func(deployment *appsv1.Deployment) error {
inputHashes, err := resourcehash.MultipleObjectHashStringMapForObjectReferences(
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to use a secret informer? MultipleObjectHashStringMapForObjectReferenceFromLister with an informer/lister from kubeInformersForNamespaces.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Done.

Once the secret changes, the annotation changes too,
which causes the Controller to be re-deployed.
@jsafrane
Copy link
Contributor

jsafrane commented Jan 7, 2021

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [bertinatto,jsafrane]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 29da524 into openshift:master Jan 7, 2021
@openshift-ci-robot
Copy link
Contributor

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

Bugzilla bug 1898045 has been moved to the MODIFIED state.

In response to this:

Bug 1898045: redeploy CSI Controller Deployment when secret changes

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.

@bertinatto
Copy link
Member Author

I manually tested the last changes and they worked.

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-high Referenced Bugzilla bug's severity is high 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

4 participants