Skip to content

Commit e7d6c4b

Browse files
kchernyshevKonstantin Chernyshev
andauthored
chore: update VolumeSnapshot API (v1beta1->v1) and external-snapshotter (v2->v4) (#350)
Change-Id: Ia6420985afbdc162a7823968d1a4f48f30a12b45 Co-authored-by: Konstantin Chernyshev <[email protected]>
1 parent 330419f commit e7d6c4b

22 files changed

+416
-294
lines changed

common/pkg/utils/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ go_library(
77
visibility = ["//visibility:public"],
88
deps = [
99
"//common/api/v1alpha1",
10-
"@com_github_kubernetes_csi_external_snapshotter_v2//pkg/apis/volumesnapshot/v1beta1",
10+
"@com_github_kubernetes_csi_external_snapshotter_client_v4//apis/volumesnapshot/v1:volumesnapshot",
1111
"@io_k8s_api//apps/v1:apps",
1212
"@io_k8s_api//core/v1:core",
1313
"@io_k8s_apimachinery//pkg/api/resource",

common/pkg/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"net"
2323
"regexp"
2424

25-
snapv1 "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1"
25+
snapv1 "github.com/kubernetes-csi/external-snapshotter/client/v4/apis/volumesnapshot/v1"
2626
appsv1 "k8s.io/api/apps/v1"
2727
corev1 "k8s.io/api/core/v1"
2828
"k8s.io/apimachinery/pkg/api/resource"

deps.bzl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def go_dependencies():
127127
go_repository(
128128
name = "com_github_azure_go_autorest_autorest_mocks",
129129
importpath = "github.com/Azure/go-autorest/autorest/mocks",
130-
sum = "h1:Ww5g4zThfD/6cLb4z6xxgeyDa7QDkizMkJKe0ysZXp0=",
131-
version = "v0.2.0",
130+
sum = "h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc=",
131+
version = "v0.3.0",
132132
)
133133
go_repository(
134134
name = "com_github_azure_go_autorest_logger",
@@ -1136,12 +1136,19 @@ def go_dependencies():
11361136
sum = "h1:ia04uVFUM/J9n/v3LEMn3rEG6FmKV5BH9QLw7H68h44=",
11371137
version = "v2.0.0+incompatible",
11381138
)
1139+
go_repository(
1140+
name = "com_github_kubernetes_csi_external_snapshotter_client_v4",
1141+
importpath = "github.com/kubernetes-csi/external-snapshotter/client/v4",
1142+
sum = "h1:nHHjmvjitIiyPlUHk/ofpgvBcNcawJLtf4PYHORLjAA=",
1143+
version = "v4.2.0",
1144+
)
11391145
go_repository(
11401146
name = "com_github_kubernetes_csi_external_snapshotter_v2",
11411147
importpath = "github.com/kubernetes-csi/external-snapshotter/v2",
11421148
sum = "h1:DnSsW7uRNT8IRnex9r5TiWzgQRaYv9Eeo/If5fRSgLg=",
11431149
version = "v2.1.5",
11441150
)
1151+
11451152
go_repository(
11461153
name = "com_github_magiconair_properties",
11471154
importpath = "github.com/magiconair/properties",

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/google/uuid v1.3.0
1919
github.com/grpc-ecosystem/grpc-health-probe v0.4.2
2020
github.com/hpcloud/tail v1.0.0
21-
github.com/kubernetes-csi/external-snapshotter/v2 v2.1.5
21+
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0
2222
github.com/onsi/ginkgo v1.16.5
2323
github.com/onsi/gomega v1.24.1
2424
github.com/opencontainers/runc v1.1.4

go.sum

Lines changed: 26 additions & 62 deletions
Large diffs are not rendered by default.

oracle/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ go_library(
3232
"//oracle/controllers/importcontroller",
3333
"//oracle/controllers/instancecontroller",
3434
"//oracle/controllers/pitrcontroller",
35-
"@com_github_kubernetes_csi_external_snapshotter_v2//pkg/apis/volumesnapshot/v1beta1",
35+
"@com_github_kubernetes_csi_external_snapshotter_client_v4//apis/volumesnapshot/v1:volumesnapshot",
3636
"@io_k8s_apimachinery//pkg/api/errors",
3737
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
3838
"@io_k8s_apimachinery//pkg/runtime",

oracle/config/crd/testing/snapshot.storage.k8s.io_volumesnapshotclasses.yaml

Lines changed: 58 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ apiVersion: apiextensions.k8s.io/v1
44
kind: CustomResourceDefinition
55
metadata:
66
annotations:
7-
controller-gen.kubebuilder.io/version: v0.3.0
8-
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/139"
7+
controller-gen.kubebuilder.io/version: v0.4.0
8+
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/419"
99
creationTimestamp: null
1010
name: volumesnapshotclasses.snapshot.storage.k8s.io
1111
spec:
@@ -21,53 +21,37 @@ spec:
2121
- jsonPath: .driver
2222
name: Driver
2323
type: string
24-
- description: Determines whether a VolumeSnapshotContent created through the
25-
VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted.
24+
- description: Determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted.
2625
jsonPath: .deletionPolicy
2726
name: DeletionPolicy
2827
type: string
2928
- jsonPath: .metadata.creationTimestamp
3029
name: Age
3130
type: date
32-
name: v1beta1
31+
name: v1
3332
schema:
3433
openAPIV3Schema:
35-
description: VolumeSnapshotClass specifies parameters that a underlying storage
36-
system uses when creating a volume snapshot. A specific VolumeSnapshotClass
37-
is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses
38-
are non-namespaced
34+
description: VolumeSnapshotClass specifies parameters that a underlying storage system uses when creating a volume snapshot. A specific VolumeSnapshotClass is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses are non-namespaced
3935
properties:
4036
apiVersion:
41-
description: 'APIVersion defines the versioned schema of this representation
42-
of an object. Servers should convert recognized schemas to the latest
43-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
37+
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
4438
type: string
4539
deletionPolicy:
46-
description: deletionPolicy determines whether a VolumeSnapshotContent
47-
created through the VolumeSnapshotClass should be deleted when its bound
48-
VolumeSnapshot is deleted. Supported values are "Retain" and "Delete".
49-
"Retain" means that the VolumeSnapshotContent and its physical snapshot
50-
on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent
51-
and its physical snapshot on underlying storage system are deleted.
52-
Required.
40+
description: deletionPolicy determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are deleted. Required.
5341
enum:
5442
- Delete
5543
- Retain
5644
type: string
5745
driver:
58-
description: driver is the name of the storage driver that handles this
59-
VolumeSnapshotClass. Required.
46+
description: driver is the name of the storage driver that handles this VolumeSnapshotClass. Required.
6047
type: string
6148
kind:
62-
description: 'Kind is a string value representing the REST resource this
63-
object represents. Servers may infer this from the endpoint the client
64-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
49+
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
6550
type: string
6651
parameters:
6752
additionalProperties:
6853
type: string
69-
description: parameters is a key-value map with storage driver specific
70-
parameters for creating snapshots. These values are opaque to Kubernetes.
54+
description: parameters is a key-value map with storage driver specific parameters for creating snapshots. These values are opaque to Kubernetes.
7155
type: object
7256
required:
7357
- deletionPolicy
@@ -76,6 +60,54 @@ spec:
7660
served: true
7761
storage: true
7862
subresources: {}
63+
- additionalPrinterColumns:
64+
- jsonPath: .driver
65+
name: Driver
66+
type: string
67+
- description: Determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted.
68+
jsonPath: .deletionPolicy
69+
name: DeletionPolicy
70+
type: string
71+
- jsonPath: .metadata.creationTimestamp
72+
name: Age
73+
type: date
74+
name: v1beta1
75+
# This indicates the v1beta1 version of the custom resource is deprecated.
76+
# API requests to this version receive a warning in the server response.
77+
deprecated: true
78+
# This overrides the default warning returned to clients making v1beta1 API requests.
79+
deprecationWarning: "snapshot.storage.k8s.io/v1beta1 VolumeSnapshotClass is deprecated; use snapshot.storage.k8s.io/v1 VolumeSnapshotClass"
80+
schema:
81+
openAPIV3Schema:
82+
description: VolumeSnapshotClass specifies parameters that a underlying storage system uses when creating a volume snapshot. A specific VolumeSnapshotClass is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses are non-namespaced
83+
properties:
84+
apiVersion:
85+
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
86+
type: string
87+
deletionPolicy:
88+
description: deletionPolicy determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are deleted. Required.
89+
enum:
90+
- Delete
91+
- Retain
92+
type: string
93+
driver:
94+
description: driver is the name of the storage driver that handles this VolumeSnapshotClass. Required.
95+
type: string
96+
kind:
97+
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
98+
type: string
99+
parameters:
100+
additionalProperties:
101+
type: string
102+
description: parameters is a key-value map with storage driver specific parameters for creating snapshots. These values are opaque to Kubernetes.
103+
type: object
104+
required:
105+
- deletionPolicy
106+
- driver
107+
type: object
108+
served: true
109+
storage: false
110+
subresources: {}
79111
status:
80112
acceptedNames:
81113
kind: ""

0 commit comments

Comments
 (0)