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

[4.15] OCPBUGS-31599: create suitable role and roleBinding for csi-snapshot-webhook #203

Merged

Conversation

dobsonj
Copy link
Member

@dobsonj dobsonj commented Apr 1, 2024

Manual backport of #202 to 4.15 -- but only the parts required to get the correct permissions for the webhook. We don't want any of the volumegroupsnapshot changes backported.

/cc @openshift/storage @bertinatto @Phaow

@openshift-ci openshift-ci bot requested review from bertinatto and Phaow April 1, 2024 21:42
Copy link
Contributor

openshift-ci bot commented Apr 1, 2024

@dobsonj: GitHub didn't allow me to request PR reviews from the following users: openshift/storage.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Manual backport of #202 to 4.15 -- but only the parts required to get the correct permissions for the webhook. We don't want any of the volumegroupsnapshot changes backported.

/cc @openshift/storage @bertinatto @Phaow

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.

Copy link
Contributor

openshift-ci bot commented Apr 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dobsonj

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 1, 2024
@dobsonj
Copy link
Member Author

dobsonj commented Apr 1, 2024

/jira cherry-pick OCPBUGS-31497

@openshift-ci-robot
Copy link
Contributor

@dobsonj: Jira Issue OCPBUGS-31497 has been cloned as Jira Issue OCPBUGS-31599. Will retitle bug to link to clone.
/retitle OCPBUGS-31599: create suitable role and roleBinding for csi-snapshot-webhook

In response to this:

/jira cherry-pick OCPBUGS-31497

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot changed the title create suitable role and roleBinding for csi-snapshot-webhook OCPBUGS-31599: create suitable role and roleBinding for csi-snapshot-webhook Apr 1, 2024
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Apr 1, 2024
@openshift-ci-robot
Copy link
Contributor

@dobsonj: This pull request references Jira Issue OCPBUGS-31599, which is invalid:

  • expected dependent Jira Issue OCPBUGS-31497 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Manual backport of #202 to 4.15 -- but only the parts required to get the correct permissions for the webhook. We don't want any of the volumegroupsnapshot changes backported.

/cc @openshift/storage @bertinatto @Phaow

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Apr 1, 2024
@dobsonj
Copy link
Member Author

dobsonj commented Apr 1, 2024

/label backport-risk-assessed

@openshift-cherrypick-robot

@dobsonj: once the present PR merges, I will cherry-pick it on top of release-4.14 in a new PR and assign it to you.

In response to this:

/label backport-risk-assessed
/cherry-pick release-4.14

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 openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Apr 1, 2024
@dobsonj dobsonj changed the title OCPBUGS-31599: create suitable role and roleBinding for csi-snapshot-webhook [4.15] OCPBUGS-31599: create suitable role and roleBinding for csi-snapshot-webhook Apr 2, 2024
@Phaow
Copy link
Contributor

Phaow commented Apr 2, 2024

Hi @dobsonj, I checked the CI must-gather seems the webhook logs still have some VolumeGroupSnapshotClass RBAC errors. Even though we don't enable the VolumeGroupSnapshot feature, the webhook still list the related resources. Not sure it is related external-snapshotter/client/v6 while on 4.16 we rebase the external-snapshotter/client/v7 and cherry-pick several upstream fix patches in https://issues.redhat.com/browse/OCPBUGS-31439.

omc logs csi-snapshot-webhook-75d8ffb974-j4427
2024-04-01T22:01:05.358426627Z I0401 22:01:05.358322       1 certwatcher.go:129] Updated current TLS certificate
2024-04-01T22:01:05.374647968Z W0401 22:01:05.374603       1 reflector.go:535] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:openshift-cluster-storage-operator:csi-snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
2024-04-01T22:01:05.374647968Z E0401 22:01:05.374637       1 reflector.go:147] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: Failed to watch *v1alpha1.VolumeGroupSnapshotClass: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:openshift-cluster-storage-operator:csi-snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
2024-04-01T22:01:06.957954277Z W0401 22:01:06.957896       1 reflector.go:535] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:openshift-cluster-storage-operator:csi-snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
2024-04-01T22:01:06.957954277Z E0401 22:01:06.957931       1 reflector.go:147] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: Failed to watch *v1alpha1.VolumeGroupSnapshotClass: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:openshift-cluster-storage-operator:csi-snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
2024-04-01T22:01:08.994184894Z W0401 22:01:08.994132       1 reflector.go:535] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:openshift-cluster-storage-operator:csi-snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
2024-04-01T22:01:08.994184894Z E0401 22:01:08.994162       1 reflector.go:147] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: Failed to watch *v1alpha1.VolumeGroupSnapshotClass: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:openshift-cluster-storage-operator:csi-snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope

@duanwei33
Copy link

@Phaow How about using a new Jira bug for VolumeGroupSnapshotClass, so that might be more easier and clear for backport. wdyt?

@Phaow
Copy link
Contributor

Phaow commented Apr 2, 2024

@duanwei33 Agree, it maybe a better option. Anyway let's wait @dobsonj 's suggestions.

@dobsonj
Copy link
Member Author

dobsonj commented Apr 2, 2024

@Phaow How about using a new Jira bug for VolumeGroupSnapshotClass, so that might be more easier and clear for backport. wdyt?

@duanwei33 Agree, it maybe a better option. Anyway let's wait @dobsonj 's suggestions.

IMO, no need for a separate bug, I'll revise this PR. The webhook apparently will not start unless it has the VolumeGroupSnapshotClass permission too on 4.15. I won't add any support for VolumeGroupSnapshots in 4.15, but I believe it's harmless to allow the webhook permission to run the listers.

@dobsonj
Copy link
Member Author

dobsonj commented Apr 2, 2024

I pushed VolumeGroupSnapshotClass permissions for the webhook as a separate commit. They are required for 4.15+ but should not be needed on prior versions.

@dobsonj
Copy link
Member Author

dobsonj commented Apr 2, 2024

Well... even with that last change, the webhook fails with:

W0402 17:59:24.144081       1 reflector.go:535] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: failed to list *v1alpha1.VolumeGroupSnapshotClass: the server could not find the requested resource (get volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io)
E0402 17:59:24.144138       1 reflector.go:147] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: Failed to watch *v1alpha1.VolumeGroupSnapshotClass: failed to list *v1alpha1.VolumeGroupSnapshotClass: the server could not find the requested resource (get volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io)

@dobsonj
Copy link
Member Author

dobsonj commented Apr 2, 2024

Ok, it seems we need this change backported to 4.15 to disable the VolumeGroupSnapshot listers:
kubernetes-csi/external-snapshotter@aafc456
Because in 4.15, there is no way to disable it:
https://github.com/openshift/csi-external-snapshotter/blob/50fa049ccaa48d7f7dcb165fb6e20c185a0cbd13/pkg/validation-webhook/webhook.go#L270
Once that is done, we should not need the VolumeGroupSnapshotClass RBAC permissions on 4.15.

@dobsonj
Copy link
Member Author

dobsonj commented Apr 2, 2024

/hold for openshift/csi-external-snapshotter#147 to merge first

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 2, 2024
@dobsonj
Copy link
Member Author

dobsonj commented Apr 5, 2024

/jira refresh
/test e2e-gcp-csi
/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 5, 2024
@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 5, 2024
@openshift-ci-robot
Copy link
Contributor

@dobsonj: This pull request references Jira Issue OCPBUGS-31599, which is valid.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.15.z) matches configured target version for branch (4.15.z)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • dependent bug Jira Issue OCPBUGS-31497 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-31497 targets the "4.16.0" version, which is one of the valid target versions: 4.16.0
  • bug has dependents

Requesting review from QA contact:
/cc @Phaow

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

/jira refresh
/test e2e-gcp-csi
/unhold

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

openshift-ci bot commented Apr 5, 2024

@dobsonj: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@dobsonj
Copy link
Member Author

dobsonj commented Apr 5, 2024

openshift/csi-external-snapshotter#147 merged but e2e-gcp-csi still shows volumegroupsnapshotclass failures, I think we have to wait until that PR makes it into a 4.15 build before we see good test results here.

@Phaow
Copy link
Contributor

Phaow commented Apr 7, 2024

/label cherry-pick-approved
/label qe-approved
Pre verify passed with pre merged build 4.15.0-0.ci.test-2024-04-07-083937-ci-ln-5hr786k-latest (build openshift/cluster-csi-snapshot-controller-operator#203).

CI looks good and check the controller operator and webhook logs works well.

$ oc logs -l app=csi-snapshot-webhook --tail=-1
I0407 09:31:33.853279       1 certwatcher.go:129] Updated current TLS certificate
Starting webhook server
I0407 09:31:33.955199       1 webhook.go:214] Starting certificate watcher
I0407 09:31:37.594538       1 certwatcher.go:129] Updated current TLS certificate
Starting webhook server
I0407 09:31:37.695398       1 webhook.go:214] Starting certificate watcher

@openshift-ci openshift-ci bot added cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. qe-approved Signifies that QE has signed off on this PR labels Apr 7, 2024
@dobsonj
Copy link
Member Author

dobsonj commented Apr 8, 2024

/cherry-pick release-4.14

@openshift-cherrypick-robot

@dobsonj: once the present PR merges, I will cherry-pick it on top of release-4.14 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.14

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.

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.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 87d7080 into openshift:release-4.15 Apr 8, 2024
9 checks passed
@openshift-ci-robot
Copy link
Contributor

@dobsonj: Jira Issue OCPBUGS-31599: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-31599 has been moved to the MODIFIED state.

In response to this:

Manual backport of #202 to 4.15 -- but only the parts required to get the correct permissions for the webhook. We don't want any of the volumegroupsnapshot changes backported.

/cc @openshift/storage @bertinatto @Phaow

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-cherrypick-robot

@dobsonj: new pull request created: #205

In response to this:

/cherry-pick release-4.14

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-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-cluster-csi-snapshot-controller-operator-container-v4.15.0-202404081311.p0.g87d7080.assembly.stream.el9 for distgit ose-cluster-csi-snapshot-controller-operator.
All builds following this will include this PR.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.15.0-0.nightly-2024-04-16-070254

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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet