Skip to content

Commit bc6e42d

Browse files
authored
Merge pull request #139 from xing-yang/beta
Update VolumeSnapshot CRD version to v1beta
2 parents 6fa4d49 + 0c1faac commit bc6e42d

File tree

78 files changed

+1775
-14454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1775
-14454
lines changed

Gopkg.lock

-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ required = [
4040
name = "k8s.io/code-generator"
4141
version = "kubernetes-1.14.0"
4242

43-
[[constraint]]
44-
name = "k8s.io/apiextensions-apiserver"
45-
version = "kubernetes-1.14.0"
46-
4743
[[constraint]]
4844
name = "github.com/kubernetes-csi/csi-lib-utils"
4945
version = ">=v0.6.1"

cmd/csi-snapshotter/create_crd.go

-100
This file was deleted.

cmd/csi-snapshotter/main.go

+3-18
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343
clientset "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned"
4444
snapshotscheme "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/scheme"
4545
informers "github.com/kubernetes-csi/external-snapshotter/pkg/client/informers/externalversions"
46-
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
4746
coreinformers "k8s.io/client-go/informers"
4847
)
4948

@@ -119,20 +118,6 @@ func main() {
119118
factory := informers.NewSharedInformerFactory(snapClient, *resyncPeriod)
120119
coreFactory := coreinformers.NewSharedInformerFactory(kubeClient, *resyncPeriod)
121120

122-
// Create CRD resource
123-
aeclientset, err := apiextensionsclient.NewForConfig(config)
124-
if err != nil {
125-
klog.Error(err.Error())
126-
os.Exit(1)
127-
}
128-
129-
// initialize CRD resource if it does not exist
130-
err = CreateCRD(aeclientset)
131-
if err != nil {
132-
klog.Error(err.Error())
133-
os.Exit(1)
134-
}
135-
136121
// Add Snapshot types to the defualt Kubernetes so events can be logged for them
137122
snapshotscheme.AddToScheme(scheme.Scheme)
138123

@@ -185,9 +170,9 @@ func main() {
185170
snapClient,
186171
kubeClient,
187172
*snapshotterName,
188-
factory.Snapshot().V1alpha1().VolumeSnapshots(),
189-
factory.Snapshot().V1alpha1().VolumeSnapshotContents(),
190-
factory.Snapshot().V1alpha1().VolumeSnapshotClasses(),
173+
factory.Snapshot().V1beta1().VolumeSnapshots(),
174+
factory.Snapshot().V1beta1().VolumeSnapshotContents(),
175+
factory.Snapshot().V1beta1().VolumeSnapshotClasses(),
191176
coreFactory.Core().V1().PersistentVolumeClaims(),
192177
*createSnapshotContentRetryCount,
193178
*createSnapshotContentInterval,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
2+
---
3+
apiVersion: apiextensions.k8s.io/v1beta1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: (devel)
8+
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/139"
9+
creationTimestamp: null
10+
name: volumesnapshotclasses.snapshot.storage.k8s.io
11+
spec:
12+
group: snapshot.storage.k8s.io
13+
names:
14+
kind: VolumeSnapshotClass
15+
listKind: VolumeSnapshotClassList
16+
plural: volumesnapshotclasses
17+
singular: volumesnapshotclass
18+
scope: Cluster
19+
preserveUnknownFields: false
20+
validation:
21+
openAPIV3Schema:
22+
description: VolumeSnapshotClass specifies parameters that a underlying storage
23+
system uses when creating a volume snapshot. A specific VolumeSnapshotClass
24+
is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses
25+
are non-namespaced
26+
properties:
27+
apiVersion:
28+
description: 'APIVersion defines the versioned schema of this representation
29+
of an object. Servers should convert recognized schemas to the latest
30+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
31+
type: string
32+
deletionPolicy:
33+
description: deletionPolicy determines whether a VolumeSnapshotContent created
34+
through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot
35+
is deleted. Supported values are "Retain" and "Delete". "Retain" means
36+
that the VolumeSnapshotContent and its physical snapshot on underlying
37+
storage system are kept. "Delete" means that the VolumeSnapshotContent
38+
and its physical snapshot on underlying storage system are deleted. Required.
39+
enum:
40+
- Delete
41+
- Retain
42+
type: string
43+
driver:
44+
description: driver is the name of the storage driver that handles this
45+
VolumeSnapshotClass. Required.
46+
type: string
47+
kind:
48+
description: 'Kind is a string value representing the REST resource this
49+
object represents. Servers may infer this from the endpoint the client
50+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
51+
type: string
52+
parameters:
53+
additionalProperties:
54+
type: string
55+
description: parameters is a key-value map with storage driver specific
56+
parameters for creating snapshots. These values are opaque to Kubernetes.
57+
type: object
58+
required:
59+
- deletionPolicy
60+
- driver
61+
type: object
62+
version: v1beta1
63+
versions:
64+
- name: v1beta1
65+
served: true
66+
storage: true
67+
status:
68+
acceptedNames:
69+
kind: ""
70+
plural: ""
71+
conditions: []
72+
storedVersions: []

0 commit comments

Comments
 (0)