Skip to content

Commit

Permalink
Update VolumeSnapshot CRD version to v1beta
Browse files Browse the repository at this point in the history
  • Loading branch information
xing-yang authored and yangxi committed Oct 15, 2019
1 parent 26c3eff commit 2ddf088
Show file tree
Hide file tree
Showing 77 changed files with 1,755 additions and 14,456 deletions.
16 changes: 0 additions & 16 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ required = [
name = "k8s.io/code-generator"
version = "kubernetes-1.14.0"

[[constraint]]
name = "k8s.io/apiextensions-apiserver"
version = "kubernetes-1.14.0"

[[constraint]]
name = "github.com/kubernetes-csi/csi-lib-utils"
version = ">=v0.6.1"
Expand Down
100 changes: 0 additions & 100 deletions cmd/csi-snapshotter/create_crd.go

This file was deleted.

21 changes: 3 additions & 18 deletions cmd/csi-snapshotter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (
clientset "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned"
snapshotscheme "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/scheme"
informers "github.com/kubernetes-csi/external-snapshotter/pkg/client/informers/externalversions"
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
coreinformers "k8s.io/client-go/informers"
)

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

// Create CRD resource
aeclientset, err := apiextensionsclient.NewForConfig(config)
if err != nil {
klog.Error(err.Error())
os.Exit(1)
}

// initialize CRD resource if it does not exist
err = CreateCRD(aeclientset)
if err != nil {
klog.Error(err.Error())
os.Exit(1)
}

// Add Snapshot types to the defualt Kubernetes so events can be logged for them
snapshotscheme.AddToScheme(scheme.Scheme)

Expand Down Expand Up @@ -185,9 +170,9 @@ func main() {
snapClient,
kubeClient,
*snapshotterName,
factory.Snapshot().V1alpha1().VolumeSnapshots(),
factory.Snapshot().V1alpha1().VolumeSnapshotContents(),
factory.Snapshot().V1alpha1().VolumeSnapshotClasses(),
factory.Snapshot().V1beta1().VolumeSnapshots(),
factory.Snapshot().V1beta1().VolumeSnapshotContents(),
factory.Snapshot().V1beta1().VolumeSnapshotClasses(),
coreFactory.Core().V1().PersistentVolumeClaims(),
*createSnapshotContentRetryCount,
*createSnapshotContentInterval,
Expand Down
75 changes: 75 additions & 0 deletions config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: volumesnapshotclasses.snapshot.storage.k8s.io
spec:
group: snapshot.storage.k8s.io
names:
kind: VolumeSnapshotClass
listKind: VolumeSnapshotClassList
plural: volumesnapshotclasses
singular: volumesnapshotclass
scope: Cluster
validation:
openAPIV3Schema:
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
properties:
apiVersion:
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/api-conventions.md#resources'
type: string
deletionPolicy:
allOf:
- enum:
- Delete
- Retain
- enum:
- Delete
- Retain
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.
type: string
driver:
description: driver is the name of the storage driver that handles this
VolumeSnapshotClass. Required.
type: string
kind:
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/api-conventions.md#types-kinds'
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata'
type: object
parameters:
additionalProperties:
type: string
description: parameters is a key-value map with storage driver specific
parameters for creating snapshots. These values are opaque to Kubernetes.
type: object
required:
- deletionPolicy
- driver
type: object
version: v1beta1
versions:
- name: v1beta1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit 2ddf088

Please sign in to comment.