Skip to content

Commit 2215b5a

Browse files
committed
Introduce v1beta2 VolumeGroupSnapshot API
This commit introduces the new VolumeGroupSnapshot v1beta2 API, updates the CRD and the generated code. Both v1beta1 and v1beta2 APIs are served, with v1beta1 being the stored version.
1 parent 6b2feaa commit 2215b5a

File tree

152 files changed

+6303
-102
lines changed

Some content is hidden

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

152 files changed

+6303
-102
lines changed

client/apis/volumegroupsnapshot/v1beta1/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// +k8s:deepcopy-gen=package
18+
// +groupName=groupsnapshot.storage.k8s.io
19+
20+
package v1beta2
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
package v1beta2
15+
16+
import (
17+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
18+
"k8s.io/apimachinery/pkg/runtime"
19+
"k8s.io/apimachinery/pkg/runtime/schema"
20+
)
21+
22+
// GroupName is the group name use in this package.
23+
const GroupName = "groupsnapshot.storage.k8s.io"
24+
25+
var (
26+
// SchemeBuilder is the new scheme builder
27+
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
28+
// AddToScheme adds to scheme
29+
AddToScheme = SchemeBuilder.AddToScheme
30+
// SchemeGroupVersion is the group version used to register these objects.
31+
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta2"}
32+
)
33+
34+
func Resource(resource string) schema.GroupResource {
35+
return SchemeGroupVersion.WithResource(resource).GroupResource()
36+
}
37+
38+
func init() {
39+
// We only register manually written functions here. The registration of the
40+
// generated functions takes place in the generated files. The separation
41+
// makes the code compile even when the generated files are missing.
42+
SchemeBuilder.Register(addKnownTypes)
43+
}
44+
45+
// addKnownTypes adds the set of types defined in this package to the supplied scheme.
46+
func addKnownTypes(scheme *runtime.Scheme) error {
47+
scheme.AddKnownTypes(SchemeGroupVersion,
48+
&VolumeGroupSnapshotClass{},
49+
&VolumeGroupSnapshotClassList{},
50+
&VolumeGroupSnapshot{},
51+
&VolumeGroupSnapshotList{},
52+
&VolumeGroupSnapshotContent{},
53+
&VolumeGroupSnapshotContentList{},
54+
)
55+
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
56+
return nil
57+
}

client/apis/volumegroupsnapshot/v1beta2/types.go

Lines changed: 441 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)