Bug 1906518

Summary: Update snapshot API CRDs to v1
Product: OpenShift Container Platform Reporter: Jan Safranek <jsafrane>
Component: StorageAssignee: Christian Huffman <chuffman>
Storage sub component: Operators QA Contact: Wei Duan <wduan>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: unspecified CC: aos-bugs, chuffman
Version: 4.7   
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:41:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Safranek 2020-12-10 17:22:32 UTC
csi-snapshot-controller-operator installs  volumesnapshotclasses.snapshot.storage.k8s.io/v1beta1, while Kubernetes 1.20 tests expect v1.

* Update csi-snapshot-controller-operator to install the snapshot CRDs volumesnapshotclasses.snapshot.storage.k8s.io/v1
* Enable e2e tests with [Feature:VolumeSnapshotDataSource], if they were disabled during 1.20 rebase.

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

Steps to Reproduce:
1. Create a snapshot class:

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: csi-hostpath-snapclass
driver: hostpath.csi.k8s.io #csi-hostpath
deletionPolicy: Delete

[Test also with VolumeSnapshot and VolumeSnapshotContent]

Actual results:
"the server could not find the requested resource"

Expected results:
* The snapshot class is created.
* E2e tests run tests like:
[sig-storage] CSI Volumes [Driver: csi-hostpath] [Testpattern: Dynamic PV (default fs)] provisioning should provision storage with snapshot data source [Feature:VolumeSnapshotDataSource]

Comment 4 Jan Safranek 2020-12-14 11:06:56 UTC
In 4.7, we should support both v1 and v1beta1 to give users / applications some time to update. In the API servers, objects are automatically converted between v1 and v1beta1 - you can create v1beta1 object and get v1 and the other way around. The API server prefers v1, so `oc get volumesnapshot` will get v1 version. If you want to get v1beta1 from some reason, use curl:

$ oc proxy
Starting to serve on 127.0.0.1:8001

$ curl http://localhost:8001/apis/snapshot.storage.k8s.io/v1beta1/volumesnapshots | jq
{
  "apiVersion": "snapshot.storage.k8s.io/v1beta1",
  "items": [
...
      "apiVersion": "snapshot.storage.k8s.io/v1beta1",
      "kind": "VolumeSnapshot",
...



However, external-snapshotter, which includes also snapshot controller + webhook, was not yet released for Kubernetes 1.20. It's close, but it has no exact date. My feeling is that it could be this or the next week. So, you can test the webhook only with v1beta1 API and prepare scripts for v1. Actually, you will need to re-test snapshots after we do the rebase, so it might be better to wait.

Comment 6 Wei Duan 2020-12-22 11:31:56 UTC
We'd like to use this bz to track snapshot API upgrade for basic snapshot test.

Comment 7 Wei Duan 2021-01-11 10:00:11 UTC
To some snapshot regression tests on 4.7.0-0.nightly-2021-01-10-070949.
Marked as pass.

Comment 9 errata-xmlrpc 2021-02-24 15:41:57 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