update API names in group snapshot content to be consistent with volume snapshots

This commit is contained in:
Raunak Pradip Shah
2024-01-05 11:29:03 -08:00
parent bffa5ae25f
commit 0bd355cf29
14 changed files with 169 additions and 126 deletions

View File

@@ -348,22 +348,22 @@ type VolumeGroupSnapshotContentStatus struct {
// Exactly one of its members must be set.
// Members in VolumeGroupSnapshotContentSource are immutable.
type VolumeGroupSnapshotContentSource struct {
// PersistentVolumeNames is a list of names of PersistentVolumes to be snapshotted
// VolumeHandles is a list of volume handles on the backend to be snapshotted
// together. It is specified for dynamic provisioning of the VolumeGroupSnapshot.
// This field is immutable.
// +optional
PersistentVolumeNames []string `json:"persistentVolumeNames,omitempty" protobuf:"bytes,1,opt,name=persistentVolumeNames"`
VolumeHandles []string `json:"volumeHandles,omitempty" protobuf:"bytes,1,opt,name=volumeHandles"`
// GroupSnapshotHandleSource specifies the CSI "group_snapshot_id" of a pre-existing
// GroupSnapshotHandles specifies the CSI "group_snapshot_id" of a pre-existing
// group snapshot and a list of CSI "snapshot_id" of pre-existing snapshots
// on the underlying storage system for which a Kubernetes object
// representation was (or should be) created.
// This field is immutable.
// +optional
GroupSnapshotHandleSource *VolumeGroupSnapshotHandleSource `json:"groupSnapshotHandleSource,omitempty" protobuf:"bytes,2,opt,name=groupSnapshotHandleSource"`
GroupSnapshotHandles *GroupSnapshotHandles `json:"groupSnapshotHandles,omitempty" protobuf:"bytes,2,opt,name=groupSnapshotHandles"`
}
type VolumeGroupSnapshotHandleSource struct {
type GroupSnapshotHandles struct {
// VolumeGroupSnapshotHandle specifies the CSI "group_snapshot_id" of a pre-existing
// group snapshot on the underlying storage system for which a Kubernetes object
// representation was (or should be) created.

View File

@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes Authors.
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -27,6 +27,27 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GroupSnapshotHandles) DeepCopyInto(out *GroupSnapshotHandles) {
*out = *in
if in.VolumeSnapshotHandles != nil {
in, out := &in.VolumeSnapshotHandles, &out.VolumeSnapshotHandles
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupSnapshotHandles.
func (in *GroupSnapshotHandles) DeepCopy() *GroupSnapshotHandles {
if in == nil {
return nil
}
out := new(GroupSnapshotHandles)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeGroupSnapshot) DeepCopyInto(out *VolumeGroupSnapshot) {
*out = *in
@@ -193,14 +214,14 @@ func (in *VolumeGroupSnapshotContentList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeGroupSnapshotContentSource) DeepCopyInto(out *VolumeGroupSnapshotContentSource) {
*out = *in
if in.PersistentVolumeNames != nil {
in, out := &in.PersistentVolumeNames, &out.PersistentVolumeNames
if in.VolumeHandles != nil {
in, out := &in.VolumeHandles, &out.VolumeHandles
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.GroupSnapshotHandleSource != nil {
in, out := &in.GroupSnapshotHandleSource, &out.GroupSnapshotHandleSource
*out = new(VolumeGroupSnapshotHandleSource)
if in.GroupSnapshotHandles != nil {
in, out := &in.GroupSnapshotHandles, &out.GroupSnapshotHandles
*out = new(GroupSnapshotHandles)
(*in).DeepCopyInto(*out)
}
return
@@ -280,27 +301,6 @@ func (in *VolumeGroupSnapshotContentStatus) DeepCopy() *VolumeGroupSnapshotConte
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeGroupSnapshotHandleSource) DeepCopyInto(out *VolumeGroupSnapshotHandleSource) {
*out = *in
if in.VolumeSnapshotHandles != nil {
in, out := &in.VolumeSnapshotHandles, &out.VolumeSnapshotHandles
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeGroupSnapshotHandleSource.
func (in *VolumeGroupSnapshotHandleSource) DeepCopy() *VolumeGroupSnapshotHandleSource {
if in == nil {
return nil
}
out := new(VolumeGroupSnapshotHandleSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeGroupSnapshotList) DeepCopyInto(out *VolumeGroupSnapshotList) {
*out = *in

View File

@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes Authors.
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -104,8 +104,8 @@ spec:
dynamically provisioned or already exists, and just requires a Kubernetes
object representation. This field is immutable after creation. Required.
properties:
groupSnapshotHandleSource:
description: GroupSnapshotHandleSource specifies the CSI "group_snapshot_id"
groupSnapshotHandles:
description: GroupSnapshotHandles specifies the CSI "group_snapshot_id"
of a pre-existing group snapshot and a list of CSI "snapshot_id"
of pre-existing snapshots on the underlying storage system for
which a Kubernetes object representation was (or should be)
@@ -129,17 +129,17 @@ spec:
- volumeGroupSnapshotHandle
- volumeSnapshotHandles
type: object
persistentVolumeNames:
description: PersistentVolumeNames is a list of names of PersistentVolumes
to be snapshotted together. It is specified for dynamic provisioning
of the VolumeGroupSnapshot. This field is immutable.
volumeHandles:
description: VolumeHandles is a list of volume handles on the
backend to be snapshotted together. It is specified for dynamic
provisioning of the VolumeGroupSnapshot. This field is immutable.
items:
type: string
type: array
type: object
oneOf:
- required: ["persistentVolumeNames"]
- required: ["groupSnapshotHandleSource"]
- required: ["volumeHandles"]
- required: ["groupSnapshotHandles"]
volumeGroupSnapshotClassName:
description: VolumeGroupSnapshotClassName is the name of the VolumeGroupSnapshotClass
from which this group snapshot was (or will be) created. Note that

View File

@@ -144,7 +144,7 @@ Update the restoreSize property to use type string only:
* Add the VolumeSnapshot namespace to the `additionalPrinterColumns` section. Refer https://github.com/kubernetes-csi/external-snapshotter/pull/535 for more details.
* In `client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml `, we need to add the `oneOf` constraint to make sure only one of `persistentVolumeNames` and `volumeGroupSnapshotHandle` is specified in the `source` field of the `spec` of `VolumeGroupSnapshotContent`.
* In `client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml `, we need to add the `oneOf` constraint to make sure only one of `volumeHandles` and `groupSnapshotHandles` is specified in the `source` field of the `spec` of `VolumeGroupSnapshotContent`.
```bash
source:
@@ -152,22 +152,41 @@ Update the restoreSize property to use type string only:
dynamically provisioned or already exists, and just requires a Kubernetes
object representation. This field is immutable after creation. Required.
properties:
persistentVolumeNames:
description: PersistentVolumeNames is a list of names of PersistentVolumes
to be snapshotted together. It is specified for dynamic provisioning
of the VolumeGroupSnapshot. This field is immutable.
groupSnapshotHandles:
description: GroupSnapshotHandles specifies the CSI "group_snapshot_id"
of a pre-existing group snapshot and a list of CSI "snapshot_id"
of pre-existing snapshots on the underlying storage system for
which a Kubernetes object representation was (or should be)
created. This field is immutable.
properties:
volumeGroupSnapshotHandle:
description: VolumeGroupSnapshotHandle specifies the CSI "group_snapshot_id"
of a pre-existing group snapshot on the underlying storage
system for which a Kubernetes object representation was
(or should be) created. This field is immutable. Required.
type: string
volumeSnapshotHandles:
description: VolumeSnapshotHandles is a list of CSI "snapshot_id"
of pre-existing snapshots on the underlying storage system
for which Kubernetes objects representation were (or should
be) created. This field is immutable. Required.
items:
type: string
type: array
required:
- volumeGroupSnapshotHandle
- volumeSnapshotHandles
type: object
volumeHandles:
description: VolumeHandles is a list of volume handles on the
backend to be snapshotted together. It is specified for dynamic
provisioning of the VolumeGroupSnapshot. This field is immutable.
items:
type: string
type: array
volumeGroupSnapshotHandle:
description: VolumeGroupSnapshotHandle specifies the CSI "group_snapshot_id"
of a pre-existing group snapshot on the underlying storage system
for which a Kubernetes object representation was (or should
be) created. This field is immutable.
type: string
type: object
oneOf:
- required: ["persistentVolumeNames"]
- required: ["volumeGroupSnapshotHandle"]
- required: ["volumeHandles"]
- required: ["groupSnapshotHandles"]
volumeGroupSnapshotClassName:
```