Bug 1907287 - [csi-snapshot-webhook] should support both v1beta1 and v1 version when creating volumesnapshot/volumesnapshotcontent
Summary: [csi-snapshot-webhook] should support both v1beta1 and v1 version when creati...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 4.7
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.7.0
Assignee: Jan Safranek
QA Contact: Qin Ping
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-14 06:16 UTC by Wei Duan
Modified: 2021-02-24 15:43 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:43:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-csi-snapshot-controller-operator pull 71 0 None closed Bug 1907287: Use webhook for v1 snapshot API 2021-01-29 12:42:20 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:43:24 UTC

Description Wei Duan 2020-12-14 06:16:29 UTC
Description of problem:
Currently csi-snapshot-controller-operator installs the snapshot CRDs for v1 version, when creating volumesnapshot instance with v1 version, the validation-webhook still checks the v1beta1 version and report:
Error from server: error when creating "temp.yaml": admission webhook "volumesnapshotclasses.snapshot.storage.k8s.io" denied the request: expect resource to be {snapshot.storage.k8s.io v1beta1 volumesnapshots} or {snapshot.storage.k8s.io v1beta1 volumesnapshotcontents}

Version-Release number of selected component (if applicable):
4.7.0-0.nightly-2020-12-13-224840

How reproducible:
Always

Steps to Reproduce:
1. Install aws cluster
2. Create volumesnapshotclass instance with "v1" successfully
3. Create volumesnapshot instance with "v1" failed
$ more temp.yaml 
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
  name: mysnapshot
spec:
  volumeSnapshotClassName: csi-aws-ebs-snapclass
  source:
    persistentVolumeClaimName: mypvc-ori
    
$ oc create -f temp.yaml 
Error from server: error when creating "temp.yaml": admission webhook "volumesnapshotclasses.snapshot.storage.k8s.io" denied the request: expect resource to be {snapshot.storage.k8s.io v1beta1 volumesnapshots} or {snapshot.storage.k8s.io v1beta1 volumesnapshotcontents}

Actual results:
volumesnapshot instance created failed.

    
Expected results:
volumesnapshot instance should be created successfully.

Comment 1 Jan Safranek 2020-12-14 10:32:12 UTC
We must support both snapshot.storage.k8s.io/v1 and v1beta1 for couple of releases. I admit that the snapshot webhook does not allow snapshot.storage.k8s.io/v1 yet, because external-snapshotter was not rebased to Kubernetes 1.20 version. We're waiting for upstream release.

Comment 2 Qin Ping 2020-12-16 08:14:42 UTC
If the webhook does not support snapshot.storage.k8s.io/v1, all the update(patch) options to volumesnapshot and volumesnapshotcontent will be rejected.

Comment 7 errata-xmlrpc 2021-02-24 15:43:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633


Note You need to log in before you can comment on or make changes to this bug.