mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Generated code for API changes to support CSI migration of inline volumes
Signed-off-by: Deep Debroy <ddebroy@docker.com>
This commit is contained in:
@@ -18,6 +18,7 @@ go_library(
|
||||
importpath = "k8s.io/kubernetes/pkg/apis/storage/v1",
|
||||
deps = [
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//pkg/apis/core/v1:go_default_library",
|
||||
"//pkg/apis/storage:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/api/storage/v1:go_default_library",
|
||||
|
||||
43
pkg/apis/storage/v1/zz_generated.conversion.go
generated
43
pkg/apis/storage/v1/zz_generated.conversion.go
generated
@@ -28,6 +28,7 @@ import (
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
core "k8s.io/kubernetes/pkg/apis/core"
|
||||
apiscorev1 "k8s.io/kubernetes/pkg/apis/core/v1"
|
||||
storage "k8s.io/kubernetes/pkg/apis/storage"
|
||||
)
|
||||
|
||||
@@ -211,7 +212,17 @@ func Convert_storage_VolumeAttachment_To_v1_VolumeAttachment(in *storage.VolumeA
|
||||
|
||||
func autoConvert_v1_VolumeAttachmentList_To_storage_VolumeAttachmentList(in *v1.VolumeAttachmentList, out *storage.VolumeAttachmentList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]storage.VolumeAttachment)(unsafe.Pointer(&in.Items))
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]storage.VolumeAttachment, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v1_VolumeAttachment_To_storage_VolumeAttachment(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -222,7 +233,17 @@ func Convert_v1_VolumeAttachmentList_To_storage_VolumeAttachmentList(in *v1.Volu
|
||||
|
||||
func autoConvert_storage_VolumeAttachmentList_To_v1_VolumeAttachmentList(in *storage.VolumeAttachmentList, out *v1.VolumeAttachmentList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v1.VolumeAttachment)(unsafe.Pointer(&in.Items))
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]v1.VolumeAttachment, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_storage_VolumeAttachment_To_v1_VolumeAttachment(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -233,6 +254,15 @@ func Convert_storage_VolumeAttachmentList_To_v1_VolumeAttachmentList(in *storage
|
||||
|
||||
func autoConvert_v1_VolumeAttachmentSource_To_storage_VolumeAttachmentSource(in *v1.VolumeAttachmentSource, out *storage.VolumeAttachmentSource, s conversion.Scope) error {
|
||||
out.PersistentVolumeName = (*string)(unsafe.Pointer(in.PersistentVolumeName))
|
||||
if in.InlineVolumeSpec != nil {
|
||||
in, out := &in.InlineVolumeSpec, &out.InlineVolumeSpec
|
||||
*out = new(core.PersistentVolumeSpec)
|
||||
if err := apiscorev1.Convert_v1_PersistentVolumeSpec_To_core_PersistentVolumeSpec(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.InlineVolumeSpec = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -243,6 +273,15 @@ func Convert_v1_VolumeAttachmentSource_To_storage_VolumeAttachmentSource(in *v1.
|
||||
|
||||
func autoConvert_storage_VolumeAttachmentSource_To_v1_VolumeAttachmentSource(in *storage.VolumeAttachmentSource, out *v1.VolumeAttachmentSource, s conversion.Scope) error {
|
||||
out.PersistentVolumeName = (*string)(unsafe.Pointer(in.PersistentVolumeName))
|
||||
if in.InlineVolumeSpec != nil {
|
||||
in, out := &in.InlineVolumeSpec, &out.InlineVolumeSpec
|
||||
*out = new(corev1.PersistentVolumeSpec)
|
||||
if err := apiscorev1.Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.InlineVolumeSpec = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
31
pkg/apis/storage/v1/zz_generated.defaults.go
generated
31
pkg/apis/storage/v1/zz_generated.defaults.go
generated
@@ -23,6 +23,7 @@ package v1
|
||||
import (
|
||||
v1 "k8s.io/api/storage/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
corev1 "k8s.io/kubernetes/pkg/apis/core/v1"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
@@ -31,6 +32,8 @@ import (
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
scheme.AddTypeDefaultingFunc(&v1.StorageClass{}, func(obj interface{}) { SetObjectDefaults_StorageClass(obj.(*v1.StorageClass)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1.StorageClassList{}, func(obj interface{}) { SetObjectDefaults_StorageClassList(obj.(*v1.StorageClassList)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1.VolumeAttachment{}, func(obj interface{}) { SetObjectDefaults_VolumeAttachment(obj.(*v1.VolumeAttachment)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1.VolumeAttachmentList{}, func(obj interface{}) { SetObjectDefaults_VolumeAttachmentList(obj.(*v1.VolumeAttachmentList)) })
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -44,3 +47,31 @@ func SetObjectDefaults_StorageClassList(in *v1.StorageClassList) {
|
||||
SetObjectDefaults_StorageClass(a)
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_VolumeAttachment(in *v1.VolumeAttachment) {
|
||||
if in.Spec.Source.InlineVolumeSpec != nil {
|
||||
corev1.SetDefaults_ResourceList(&in.Spec.Source.InlineVolumeSpec.Capacity)
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.HostPath != nil {
|
||||
corev1.SetDefaults_HostPathVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.HostPath)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.RBD != nil {
|
||||
corev1.SetDefaults_RBDPersistentVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.RBD)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ISCSI != nil {
|
||||
corev1.SetDefaults_ISCSIPersistentVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ISCSI)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.AzureDisk != nil {
|
||||
corev1.SetDefaults_AzureDiskVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.AzureDisk)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ScaleIO != nil {
|
||||
corev1.SetDefaults_ScaleIOPersistentVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ScaleIO)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_VolumeAttachmentList(in *v1.VolumeAttachmentList) {
|
||||
for i := range in.Items {
|
||||
a := &in.Items[i]
|
||||
SetObjectDefaults_VolumeAttachment(a)
|
||||
}
|
||||
}
|
||||
|
||||
45
pkg/apis/storage/v1alpha1/zz_generated.conversion.go
generated
45
pkg/apis/storage/v1alpha1/zz_generated.conversion.go
generated
@@ -23,9 +23,12 @@ package v1alpha1
|
||||
import (
|
||||
unsafe "unsafe"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
v1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
core "k8s.io/kubernetes/pkg/apis/core"
|
||||
v1 "k8s.io/kubernetes/pkg/apis/core/v1"
|
||||
storage "k8s.io/kubernetes/pkg/apis/storage"
|
||||
)
|
||||
|
||||
@@ -133,7 +136,17 @@ func Convert_storage_VolumeAttachment_To_v1alpha1_VolumeAttachment(in *storage.V
|
||||
|
||||
func autoConvert_v1alpha1_VolumeAttachmentList_To_storage_VolumeAttachmentList(in *v1alpha1.VolumeAttachmentList, out *storage.VolumeAttachmentList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]storage.VolumeAttachment)(unsafe.Pointer(&in.Items))
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]storage.VolumeAttachment, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v1alpha1_VolumeAttachment_To_storage_VolumeAttachment(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -144,7 +157,17 @@ func Convert_v1alpha1_VolumeAttachmentList_To_storage_VolumeAttachmentList(in *v
|
||||
|
||||
func autoConvert_storage_VolumeAttachmentList_To_v1alpha1_VolumeAttachmentList(in *storage.VolumeAttachmentList, out *v1alpha1.VolumeAttachmentList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v1alpha1.VolumeAttachment)(unsafe.Pointer(&in.Items))
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]v1alpha1.VolumeAttachment, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_storage_VolumeAttachment_To_v1alpha1_VolumeAttachment(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -155,6 +178,15 @@ func Convert_storage_VolumeAttachmentList_To_v1alpha1_VolumeAttachmentList(in *s
|
||||
|
||||
func autoConvert_v1alpha1_VolumeAttachmentSource_To_storage_VolumeAttachmentSource(in *v1alpha1.VolumeAttachmentSource, out *storage.VolumeAttachmentSource, s conversion.Scope) error {
|
||||
out.PersistentVolumeName = (*string)(unsafe.Pointer(in.PersistentVolumeName))
|
||||
if in.InlineVolumeSpec != nil {
|
||||
in, out := &in.InlineVolumeSpec, &out.InlineVolumeSpec
|
||||
*out = new(core.PersistentVolumeSpec)
|
||||
if err := v1.Convert_v1_PersistentVolumeSpec_To_core_PersistentVolumeSpec(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.InlineVolumeSpec = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -165,6 +197,15 @@ func Convert_v1alpha1_VolumeAttachmentSource_To_storage_VolumeAttachmentSource(i
|
||||
|
||||
func autoConvert_storage_VolumeAttachmentSource_To_v1alpha1_VolumeAttachmentSource(in *storage.VolumeAttachmentSource, out *v1alpha1.VolumeAttachmentSource, s conversion.Scope) error {
|
||||
out.PersistentVolumeName = (*string)(unsafe.Pointer(in.PersistentVolumeName))
|
||||
if in.InlineVolumeSpec != nil {
|
||||
in, out := &in.InlineVolumeSpec, &out.InlineVolumeSpec
|
||||
*out = new(corev1.PersistentVolumeSpec)
|
||||
if err := v1.Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.InlineVolumeSpec = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
32
pkg/apis/storage/v1alpha1/zz_generated.defaults.go
generated
32
pkg/apis/storage/v1alpha1/zz_generated.defaults.go
generated
@@ -21,12 +21,44 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
v1 "k8s.io/kubernetes/pkg/apis/core/v1"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
scheme.AddTypeDefaultingFunc(&v1alpha1.VolumeAttachment{}, func(obj interface{}) { SetObjectDefaults_VolumeAttachment(obj.(*v1alpha1.VolumeAttachment)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1alpha1.VolumeAttachmentList{}, func(obj interface{}) { SetObjectDefaults_VolumeAttachmentList(obj.(*v1alpha1.VolumeAttachmentList)) })
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetObjectDefaults_VolumeAttachment(in *v1alpha1.VolumeAttachment) {
|
||||
if in.Spec.Source.InlineVolumeSpec != nil {
|
||||
v1.SetDefaults_ResourceList(&in.Spec.Source.InlineVolumeSpec.Capacity)
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.HostPath != nil {
|
||||
v1.SetDefaults_HostPathVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.HostPath)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.RBD != nil {
|
||||
v1.SetDefaults_RBDPersistentVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.RBD)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ISCSI != nil {
|
||||
v1.SetDefaults_ISCSIPersistentVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ISCSI)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.AzureDisk != nil {
|
||||
v1.SetDefaults_AzureDiskVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.AzureDisk)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ScaleIO != nil {
|
||||
v1.SetDefaults_ScaleIOPersistentVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ScaleIO)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_VolumeAttachmentList(in *v1alpha1.VolumeAttachmentList) {
|
||||
for i := range in.Items {
|
||||
a := &in.Items[i]
|
||||
SetObjectDefaults_VolumeAttachment(a)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ go_library(
|
||||
importpath = "k8s.io/kubernetes/pkg/apis/storage/v1beta1",
|
||||
deps = [
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//pkg/apis/core/v1:go_default_library",
|
||||
"//pkg/apis/storage:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/api/storage/v1beta1:go_default_library",
|
||||
|
||||
43
pkg/apis/storage/v1beta1/zz_generated.conversion.go
generated
43
pkg/apis/storage/v1beta1/zz_generated.conversion.go
generated
@@ -28,6 +28,7 @@ import (
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
core "k8s.io/kubernetes/pkg/apis/core"
|
||||
corev1 "k8s.io/kubernetes/pkg/apis/core/v1"
|
||||
storage "k8s.io/kubernetes/pkg/apis/storage"
|
||||
)
|
||||
|
||||
@@ -443,7 +444,17 @@ func Convert_storage_VolumeAttachment_To_v1beta1_VolumeAttachment(in *storage.Vo
|
||||
|
||||
func autoConvert_v1beta1_VolumeAttachmentList_To_storage_VolumeAttachmentList(in *v1beta1.VolumeAttachmentList, out *storage.VolumeAttachmentList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]storage.VolumeAttachment)(unsafe.Pointer(&in.Items))
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]storage.VolumeAttachment, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v1beta1_VolumeAttachment_To_storage_VolumeAttachment(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -454,7 +465,17 @@ func Convert_v1beta1_VolumeAttachmentList_To_storage_VolumeAttachmentList(in *v1
|
||||
|
||||
func autoConvert_storage_VolumeAttachmentList_To_v1beta1_VolumeAttachmentList(in *storage.VolumeAttachmentList, out *v1beta1.VolumeAttachmentList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]v1beta1.VolumeAttachment)(unsafe.Pointer(&in.Items))
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]v1beta1.VolumeAttachment, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_storage_VolumeAttachment_To_v1beta1_VolumeAttachment(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -465,6 +486,15 @@ func Convert_storage_VolumeAttachmentList_To_v1beta1_VolumeAttachmentList(in *st
|
||||
|
||||
func autoConvert_v1beta1_VolumeAttachmentSource_To_storage_VolumeAttachmentSource(in *v1beta1.VolumeAttachmentSource, out *storage.VolumeAttachmentSource, s conversion.Scope) error {
|
||||
out.PersistentVolumeName = (*string)(unsafe.Pointer(in.PersistentVolumeName))
|
||||
if in.InlineVolumeSpec != nil {
|
||||
in, out := &in.InlineVolumeSpec, &out.InlineVolumeSpec
|
||||
*out = new(core.PersistentVolumeSpec)
|
||||
if err := corev1.Convert_v1_PersistentVolumeSpec_To_core_PersistentVolumeSpec(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.InlineVolumeSpec = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -475,6 +505,15 @@ func Convert_v1beta1_VolumeAttachmentSource_To_storage_VolumeAttachmentSource(in
|
||||
|
||||
func autoConvert_storage_VolumeAttachmentSource_To_v1beta1_VolumeAttachmentSource(in *storage.VolumeAttachmentSource, out *v1beta1.VolumeAttachmentSource, s conversion.Scope) error {
|
||||
out.PersistentVolumeName = (*string)(unsafe.Pointer(in.PersistentVolumeName))
|
||||
if in.InlineVolumeSpec != nil {
|
||||
in, out := &in.InlineVolumeSpec, &out.InlineVolumeSpec
|
||||
*out = new(v1.PersistentVolumeSpec)
|
||||
if err := corev1.Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.InlineVolumeSpec = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
31
pkg/apis/storage/v1beta1/zz_generated.defaults.go
generated
31
pkg/apis/storage/v1beta1/zz_generated.defaults.go
generated
@@ -23,6 +23,7 @@ package v1beta1
|
||||
import (
|
||||
v1beta1 "k8s.io/api/storage/v1beta1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
v1 "k8s.io/kubernetes/pkg/apis/core/v1"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
@@ -33,6 +34,8 @@ func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
scheme.AddTypeDefaultingFunc(&v1beta1.CSIDriverList{}, func(obj interface{}) { SetObjectDefaults_CSIDriverList(obj.(*v1beta1.CSIDriverList)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1beta1.StorageClass{}, func(obj interface{}) { SetObjectDefaults_StorageClass(obj.(*v1beta1.StorageClass)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1beta1.StorageClassList{}, func(obj interface{}) { SetObjectDefaults_StorageClassList(obj.(*v1beta1.StorageClassList)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1beta1.VolumeAttachment{}, func(obj interface{}) { SetObjectDefaults_VolumeAttachment(obj.(*v1beta1.VolumeAttachment)) })
|
||||
scheme.AddTypeDefaultingFunc(&v1beta1.VolumeAttachmentList{}, func(obj interface{}) { SetObjectDefaults_VolumeAttachmentList(obj.(*v1beta1.VolumeAttachmentList)) })
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -57,3 +60,31 @@ func SetObjectDefaults_StorageClassList(in *v1beta1.StorageClassList) {
|
||||
SetObjectDefaults_StorageClass(a)
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_VolumeAttachment(in *v1beta1.VolumeAttachment) {
|
||||
if in.Spec.Source.InlineVolumeSpec != nil {
|
||||
v1.SetDefaults_ResourceList(&in.Spec.Source.InlineVolumeSpec.Capacity)
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.HostPath != nil {
|
||||
v1.SetDefaults_HostPathVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.HostPath)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.RBD != nil {
|
||||
v1.SetDefaults_RBDPersistentVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.RBD)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ISCSI != nil {
|
||||
v1.SetDefaults_ISCSIPersistentVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ISCSI)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.AzureDisk != nil {
|
||||
v1.SetDefaults_AzureDiskVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.AzureDisk)
|
||||
}
|
||||
if in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ScaleIO != nil {
|
||||
v1.SetDefaults_ScaleIOPersistentVolumeSource(in.Spec.Source.InlineVolumeSpec.PersistentVolumeSource.ScaleIO)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func SetObjectDefaults_VolumeAttachmentList(in *v1beta1.VolumeAttachmentList) {
|
||||
for i := range in.Items {
|
||||
a := &in.Items[i]
|
||||
SetObjectDefaults_VolumeAttachment(a)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,12 @@ go_library(
|
||||
"//pkg/apis/core/helper:go_default_library",
|
||||
"//pkg/apis/core/validation:go_default_library",
|
||||
"//pkg/apis/storage:go_default_library",
|
||||
"//pkg/features:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/validation:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
||||
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -29,7 +31,11 @@ go_test(
|
||||
deps = [
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//pkg/apis/storage:go_default_library",
|
||||
"//pkg/features:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
|
||||
"//staging/src/k8s.io/component-base/featuregate/testing:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
5
pkg/apis/storage/zz_generated.deepcopy.go
generated
5
pkg/apis/storage/zz_generated.deepcopy.go
generated
@@ -377,6 +377,11 @@ func (in *VolumeAttachmentSource) DeepCopyInto(out *VolumeAttachmentSource) {
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.InlineVolumeSpec != nil {
|
||||
in, out := &in.InlineVolumeSpec, &out.InlineVolumeSpec
|
||||
*out = new(core.PersistentVolumeSpec)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user