mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
add rados block device(rbd) volume plugin
Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
@@ -1277,6 +1277,14 @@ func convert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *api.Per
|
||||
} else {
|
||||
out.NFS = nil
|
||||
}
|
||||
if in.RBD != nil {
|
||||
out.RBD = new(RBDVolumeSource)
|
||||
if err := convert_api_RBDVolumeSource_To_v1_RBDVolumeSource(in.RBD, out.RBD, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.RBD = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1604,6 +1612,35 @@ func convert_api_Probe_To_v1_Probe(in *api.Probe, out *Probe, s conversion.Scope
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_api_RBDVolumeSource_To_v1_RBDVolumeSource(in *api.RBDVolumeSource, out *RBDVolumeSource, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*api.RBDVolumeSource))(in)
|
||||
}
|
||||
if in.CephMonitors != nil {
|
||||
out.CephMonitors = make([]string, len(in.CephMonitors))
|
||||
for i := range in.CephMonitors {
|
||||
out.CephMonitors[i] = in.CephMonitors[i]
|
||||
}
|
||||
} else {
|
||||
out.CephMonitors = nil
|
||||
}
|
||||
out.RBDImage = in.RBDImage
|
||||
out.FSType = in.FSType
|
||||
out.RBDPool = in.RBDPool
|
||||
out.RadosUser = in.RadosUser
|
||||
out.Keyring = in.Keyring
|
||||
if in.SecretRef != nil {
|
||||
out.SecretRef = new(LocalObjectReference)
|
||||
if err := convert_api_LocalObjectReference_To_v1_LocalObjectReference(in.SecretRef, out.SecretRef, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.SecretRef = nil
|
||||
}
|
||||
out.ReadOnly = in.ReadOnly
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_api_RangeAllocation_To_v1_RangeAllocation(in *api.RangeAllocation, out *RangeAllocation, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*api.RangeAllocation))(in)
|
||||
@@ -2235,6 +2272,14 @@ func convert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out *Volu
|
||||
} else {
|
||||
out.PersistentVolumeClaimVolumeSource = nil
|
||||
}
|
||||
if in.RBD != nil {
|
||||
out.RBD = new(RBDVolumeSource)
|
||||
if err := convert_api_RBDVolumeSource_To_v1_RBDVolumeSource(in.RBD, out.RBD, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.RBD = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -3490,6 +3535,14 @@ func convert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(in *Persist
|
||||
} else {
|
||||
out.NFS = nil
|
||||
}
|
||||
if in.RBD != nil {
|
||||
out.RBD = new(api.RBDVolumeSource)
|
||||
if err := convert_v1_RBDVolumeSource_To_api_RBDVolumeSource(in.RBD, out.RBD, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.RBD = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -3817,6 +3870,35 @@ func convert_v1_Probe_To_api_Probe(in *Probe, out *api.Probe, s conversion.Scope
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_RBDVolumeSource_To_api_RBDVolumeSource(in *RBDVolumeSource, out *api.RBDVolumeSource, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*RBDVolumeSource))(in)
|
||||
}
|
||||
if in.CephMonitors != nil {
|
||||
out.CephMonitors = make([]string, len(in.CephMonitors))
|
||||
for i := range in.CephMonitors {
|
||||
out.CephMonitors[i] = in.CephMonitors[i]
|
||||
}
|
||||
} else {
|
||||
out.CephMonitors = nil
|
||||
}
|
||||
out.RBDImage = in.RBDImage
|
||||
out.FSType = in.FSType
|
||||
out.RBDPool = in.RBDPool
|
||||
out.RadosUser = in.RadosUser
|
||||
out.Keyring = in.Keyring
|
||||
if in.SecretRef != nil {
|
||||
out.SecretRef = new(api.LocalObjectReference)
|
||||
if err := convert_v1_LocalObjectReference_To_api_LocalObjectReference(in.SecretRef, out.SecretRef, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.SecretRef = nil
|
||||
}
|
||||
out.ReadOnly = in.ReadOnly
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_RangeAllocation_To_api_RangeAllocation(in *RangeAllocation, out *api.RangeAllocation, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*RangeAllocation))(in)
|
||||
@@ -4448,6 +4530,14 @@ func convert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.Volu
|
||||
} else {
|
||||
out.PersistentVolumeClaimVolumeSource = nil
|
||||
}
|
||||
if in.RBD != nil {
|
||||
out.RBD = new(api.RBDVolumeSource)
|
||||
if err := convert_v1_RBDVolumeSource_To_api_RBDVolumeSource(in.RBD, out.RBD, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.RBD = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -4533,6 +4623,7 @@ func init() {
|
||||
convert_api_PodTemplate_To_v1_PodTemplate,
|
||||
convert_api_Pod_To_v1_Pod,
|
||||
convert_api_Probe_To_v1_Probe,
|
||||
convert_api_RBDVolumeSource_To_v1_RBDVolumeSource,
|
||||
convert_api_RangeAllocation_To_v1_RangeAllocation,
|
||||
convert_api_ReplicationControllerList_To_v1_ReplicationControllerList,
|
||||
convert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec,
|
||||
@@ -4642,6 +4733,7 @@ func init() {
|
||||
convert_v1_PodTemplate_To_api_PodTemplate,
|
||||
convert_v1_Pod_To_api_Pod,
|
||||
convert_v1_Probe_To_api_Probe,
|
||||
convert_v1_RBDVolumeSource_To_api_RBDVolumeSource,
|
||||
convert_v1_RangeAllocation_To_api_RangeAllocation,
|
||||
convert_v1_ReplicationControllerList_To_api_ReplicationControllerList,
|
||||
convert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec,
|
||||
|
||||
Reference in New Issue
Block a user