Skip to content

Commit 9dcaddc

Browse files
authored
Merge pull request #846 from bjschafer/fix-crds
Fix CRDs missing metadata fields
2 parents 8dc5dcb + 7308dc4 commit 9dcaddc

7 files changed

+18
-16
lines changed

client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.3
76
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
7+
controller-gen.kubebuilder.io/version: v0.12.0
88
creationTimestamp: null
99
name: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io
1010
spec:
@@ -66,6 +66,8 @@ spec:
6666
object represents. Servers may infer this from the endpoint the client
6767
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
6868
type: string
69+
metadata:
70+
type: object
6971
parameters:
7072
additionalProperties:
7173
type: string

client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.3
76
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
7+
controller-gen.kubebuilder.io/version: v0.12.0
88
creationTimestamp: null
99
name: volumegroupsnapshotcontents.groupsnapshot.storage.k8s.io
1010
spec:
@@ -70,6 +70,8 @@ spec:
7070
object represents. Servers may infer this from the endpoint the client
7171
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
7272
type: string
73+
metadata:
74+
type: object
7375
spec:
7476
description: Spec defines properties of a VolumeGroupSnapshotContent created
7577
by the underlying storage system. Required.

client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.3
76
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
7+
controller-gen.kubebuilder.io/version: v0.12.0
88
creationTimestamp: null
99
name: volumegroupsnapshots.groupsnapshot.storage.k8s.io
1010
spec:
@@ -60,6 +60,8 @@ spec:
6060
object represents. Servers may infer this from the endpoint the client
6161
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
6262
type: string
63+
metadata:
64+
type: object
6365
spec:
6466
description: Spec defines the desired characteristics of a group snapshot
6567
requested by a user. Required.

client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.3
76
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
7+
controller-gen.kubebuilder.io/version: v0.12.0
88
creationTimestamp: null
99
name: volumesnapshotclasses.snapshot.storage.k8s.io
1010
spec:
@@ -65,6 +65,8 @@ spec:
6565
object represents. Servers may infer this from the endpoint the client
6666
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
6767
type: string
68+
metadata:
69+
type: object
6870
parameters:
6971
additionalProperties:
7072
type: string

client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.3
76
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
7+
controller-gen.kubebuilder.io/version: v0.12.0
88
creationTimestamp: null
99
name: volumesnapshotcontents.snapshot.storage.k8s.io
1010
spec:
@@ -71,6 +71,8 @@ spec:
7171
object represents. Servers may infer this from the endpoint the client
7272
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
7373
type: string
74+
metadata:
75+
type: object
7476
spec:
7577
description: spec defines properties of a VolumeSnapshotContent created
7678
by the underlying storage system. Required.

client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.3
76
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
7+
controller-gen.kubebuilder.io/version: v0.12.0
88
creationTimestamp: null
99
name: volumesnapshots.snapshot.storage.k8s.io
1010
spec:
@@ -74,6 +74,8 @@ spec:
7474
object represents. Servers may infer this from the endpoint the client
7575
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
7676
type: string
77+
metadata:
78+
type: object
7779
spec:
7880
description: 'spec defines the desired characteristics of a snapshot requested
7981
by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots

client/hack/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ Follow these steps to update the CRD:
6666

6767
* Add api-approved.kubernetes.io annotation value in all yaml files in the metadata section with the PR where the API is approved by the API reviewers. The current approved PR for snapshot v1 API is https://github.com/kubernetes-csi/external-snapshotter/pull/419. Refer to https://github.com/kubernetes/enhancements/pull/1111 for details about this annotation.
6868

69-
* Remove any metadata sections from the yaml file which does not belong to the generated type.
70-
For example, the following command will add a metadata section for a nested object, remove any newly added metadata sections. TODO(xiangqian): this is to make sure the generated CRD is compatible with apiextensions.k8s.io/v1. Once controller-gen supports generating CRD with apiextensions.k8s.io/v1, switch to use the correct version of controller-gen and remove the last step from this README.
71-
72-
```bash
73-
./hack/update-crd.sh; git diff
74-
+ metadata:
75-
+ description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
76-
type: object
77-
```
78-
7969
* Update the restoreSize property to string in snapshot.storage.k8s.io_volumesnapshots.yaml
8070

8171
The generated yaml file contains restoreSize property anyOf as described below:

0 commit comments

Comments
 (0)