Merge pull request #37237 from jpeeler/implementation-volumeaio

Automatic merge from submit-queue (batch tested with PRs 41709, 41685, 41754, 41759, 37237)

Projected volume plugin

This is a WIP volume driver implementation as noted in the commit for https://github.com/kubernetes/kubernetes/pull/35313.
This commit is contained in:
Kubernetes Submit Queue
2017-02-21 04:27:51 -08:00
committed by GitHub
47 changed files with 10441 additions and 2113 deletions

View File

@@ -39,6 +39,7 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {
SetDefaults_SecretVolumeSource,
SetDefaults_ConfigMapVolumeSource,
SetDefaults_DownwardAPIVolumeSource,
SetDefaults_ProjectedVolumeSource,
SetDefaults_Secret,
SetDefaults_PersistentVolume,
SetDefaults_PersistentVolumeClaim,
@@ -218,6 +219,12 @@ func SetDefaults_Secret(obj *Secret) {
obj.Type = SecretTypeOpaque
}
}
func SetDefaults_ProjectedVolumeSource(obj *ProjectedVolumeSource) {
if obj.DefaultMode == nil {
perm := int32(ProjectedVolumeSourceDefaultMode)
obj.DefaultMode = &perm
}
}
func SetDefaults_PersistentVolume(obj *PersistentVolume) {
if obj.Status.Phase == "" {
obj.Status.Phase = VolumePending

View File

@@ -376,6 +376,28 @@ func TestSetDefaultDownwardAPIVolumeSource(t *testing.T) {
}
}
func TestSetDefaultProjectedVolumeSource(t *testing.T) {
s := v1.PodSpec{}
s.Volumes = []v1.Volume{
{
VolumeSource: v1.VolumeSource{
Projected: &v1.ProjectedVolumeSource{},
},
},
}
pod := &v1.Pod{
Spec: s,
}
output := roundTrip(t, runtime.Object(pod))
pod2 := output.(*v1.Pod)
defaultMode := pod2.Spec.Volumes[0].VolumeSource.Projected.DefaultMode
expectedMode := v1.ProjectedVolumeSourceDefaultMode
if defaultMode == nil || *defaultMode != expectedMode {
t.Errorf("Expected ProjectedVolumeSource DefaultMode %v, got %v", expectedMode, defaultMode)
}
}
func TestSetDefaultSecret(t *testing.T) {
s := &v1.Secret{}
obj2 := roundTrip(t, runtime.Object(s))

File diff suppressed because it is too large Load Diff

View File

@@ -309,6 +309,31 @@ message ConfigMapList {
repeated ConfigMap items = 2;
}
// Adapts a ConfigMap into a projected volume.
//
// The contents of the target ConfigMap's Data field will be presented in a
// projected volume as files using the keys in the Data field as the file names,
// unless the items element is populated with specific mappings of keys to paths.
// Note that this is identical to a configmap volume source without the default
// mode.
message ConfigMapProjection {
optional LocalObjectReference localObjectReference = 1;
// If unspecified, each key-value pair in the Data field of the referenced
// ConfigMap will be projected into the volume as a file whose name is the
// key and content is the value. If specified, the listed keys will be
// projected into the specified paths, and unlisted keys will not be
// present. If a key is specified which is not present in the ConfigMap,
// the volume setup will error unless it is marked optional. Paths must be
// relative and may not contain the '..' path or start with '..'.
// +optional
repeated KeyToPath items = 2;
// Specify whether the ConfigMap or it's keys must be defined
// +optional
optional bool optional = 4;
}
// Adapts a ConfigMap into a volume.
//
// The contents of the target ConfigMap's Data field will be presented in a
@@ -661,6 +686,15 @@ message DeleteOptions {
optional bool orphanDependents = 3;
}
// Represents downward API info for projecting into a projected volume.
// Note that this is identical to a downwardAPI volume source without the default
// mode.
message DownwardAPIProjection {
// Items is a list of DownwardAPIVolume file
// +optional
repeated DownwardAPIVolumeFile items = 1;
}
// DownwardAPIVolumeFile represents information to create the file containing the pod field
message DownwardAPIVolumeFile {
// Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
@@ -2807,6 +2841,20 @@ message Probe {
optional int32 failureThreshold = 6;
}
// Represents a projected volume source
message ProjectedVolumeSource {
// list of volume projections
repeated VolumeProjection sources = 1;
// Mode bits to use on created files by default. Must be a value between
// 0 and 0777.
// Directories within the path are not affected by this setting.
// This might be in conflict with other options that affect the file
// mode, like fsGroup, and the result can be other mode bits set.
// +optional
optional int32 defaultMode = 2;
}
// Represents a Quobyte mount that lasts the lifetime of a pod.
// Quobyte volumes do not support ownership management or SELinux relabeling.
message QuobyteVolumeSource {
@@ -3183,6 +3231,30 @@ message SecretList {
repeated Secret items = 2;
}
// Adapts a secret into a projected volume.
//
// The contents of the target Secret's Data field will be presented in a
// projected volume as files using the keys in the Data field as the file names.
// Note that this is identical to a secret volume source without the default
// mode.
message SecretProjection {
optional LocalObjectReference localObjectReference = 1;
// If unspecified, each key-value pair in the Data field of the referenced
// Secret will be projected into the volume as a file whose name is the
// key and content is the value. If specified, the listed keys will be
// projected into the specified paths, and unlisted keys will not be
// present. If a key is specified which is not present in the Secret,
// the volume setup will error unless it is marked optional. Paths must be
// relative and may not contain the '..' path or start with '..'.
// +optional
repeated KeyToPath items = 2;
// Specify whether the Secret or its key must be defined
// +optional
optional bool optional = 4;
}
// Adapts a Secret into a volume.
//
// The contents of the target Secret's Data field will be presented in a volume
@@ -3591,6 +3663,18 @@ message VolumeMount {
optional string subPath = 4;
}
// Projection that may be projected along with other supported volume types
message VolumeProjection {
// information about the secret data to project
optional SecretProjection secret = 1;
// information about the downwardAPI data to project
optional DownwardAPIProjection downwardAPI = 2;
// information about the configMap data to project
optional ConfigMapProjection configMap = 3;
}
// Represents the source of a volume to mount.
// Only one of its members may be specified.
message VolumeSource {
@@ -3707,6 +3791,9 @@ message VolumeSource {
// PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine
optional PhotonPersistentDiskVolumeSource photonPersistentDisk = 23;
// Items for all in one resources secrets, configmaps, and downward API
optional ProjectedVolumeSource projected = 24;
}
// Represents a vSphere volume resource.

File diff suppressed because it is too large Load Diff

View File

@@ -326,6 +326,8 @@ type VolumeSource struct {
AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,22,opt,name=azureDisk"`
// PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine
PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,23,opt,name=photonPersistentDisk"`
// Items for all in one resources secrets, configmaps, and downward API
Projected *ProjectedVolumeSource `json:"projected,omitempty"`
}
// PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace.
@@ -944,6 +946,28 @@ const (
SecretVolumeSourceDefaultMode int32 = 0644
)
// Adapts a secret into a projected volume.
//
// The contents of the target Secret's Data field will be presented in a
// projected volume as files using the keys in the Data field as the file names.
// Note that this is identical to a secret volume source without the default
// mode.
type SecretProjection struct {
LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"`
// If unspecified, each key-value pair in the Data field of the referenced
// Secret will be projected into the volume as a file whose name is the
// key and content is the value. If specified, the listed keys will be
// projected into the specified paths, and unlisted keys will not be
// present. If a key is specified which is not present in the Secret,
// the volume setup will error unless it is marked optional. Paths must be
// relative and may not contain the '..' path or start with '..'.
// +optional
Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"`
// Specify whether the Secret or its key must be defined
// +optional
Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"`
}
// Represents an NFS mount that lasts the lifetime of a pod.
// NFS volumes do not support ownership management or SELinux relabeling.
type NFSVolumeSource struct {
@@ -1108,6 +1132,58 @@ const (
ConfigMapVolumeSourceDefaultMode int32 = 0644
)
// Adapts a ConfigMap into a projected volume.
//
// The contents of the target ConfigMap's Data field will be presented in a
// projected volume as files using the keys in the Data field as the file names,
// unless the items element is populated with specific mappings of keys to paths.
// Note that this is identical to a configmap volume source without the default
// mode.
type ConfigMapProjection struct {
LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"`
// If unspecified, each key-value pair in the Data field of the referenced
// ConfigMap will be projected into the volume as a file whose name is the
// key and content is the value. If specified, the listed keys will be
// projected into the specified paths, and unlisted keys will not be
// present. If a key is specified which is not present in the ConfigMap,
// the volume setup will error unless it is marked optional. Paths must be
// relative and may not contain the '..' path or start with '..'.
// +optional
Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"`
// Specify whether the ConfigMap or it's keys must be defined
// +optional
Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"`
}
// Represents a projected volume source
type ProjectedVolumeSource struct {
// list of volume projections
Sources []VolumeProjection `json:"sources"`
// Mode bits to use on created files by default. Must be a value between
// 0 and 0777.
// Directories within the path are not affected by this setting.
// This might be in conflict with other options that affect the file
// mode, like fsGroup, and the result can be other mode bits set.
// +optional
DefaultMode *int32 `json:"defaultMode,omitempty"`
}
// Projection that may be projected along with other supported volume types
type VolumeProjection struct {
// all types below are the supported types for projection into the same volume
// information about the secret data to project
Secret *SecretProjection `json:"secret,omitempty"`
// information about the downwardAPI data to project
DownwardAPI *DownwardAPIProjection `json:"downwardAPI,omitempty"`
// information about the configMap data to project
ConfigMap *ConfigMapProjection `json:"configMap,omitempty"`
}
const (
ProjectedVolumeSourceDefaultMode int32 = 0644
)
// Maps a string key to a path within a volume.
type KeyToPath struct {
// The key to project.
@@ -4097,6 +4173,15 @@ type DownwardAPIVolumeFile struct {
Mode *int32 `json:"mode,omitempty" protobuf:"varint,4,opt,name=mode"`
}
// Represents downward API info for projecting into a projected volume.
// Note that this is identical to a downwardAPI volume source without the default
// mode.
type DownwardAPIProjection struct {
// Items is a list of DownwardAPIVolume file
// +optional
Items []DownwardAPIVolumeFile `json:"items,omitempty" protobuf:"bytes,1,rep,name=items"`
}
// SecurityContext holds security configuration that will be applied to a container.
// Some fields are present in both SecurityContext and PodSecurityContext. When both
// are set, the values in SecurityContext take precedence.

View File

@@ -209,6 +209,16 @@ func (ConfigMapList) SwaggerDoc() map[string]string {
return map_ConfigMapList
}
var map_ConfigMapProjection = map[string]string{
"": "Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.",
"items": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.",
"optional": "Specify whether the ConfigMap or it's keys must be defined",
}
func (ConfigMapProjection) SwaggerDoc() map[string]string {
return map_ConfigMapProjection
}
var map_ConfigMapVolumeSource = map[string]string{
"": "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.",
"items": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.",
@@ -352,6 +362,15 @@ func (DeleteOptions) SwaggerDoc() map[string]string {
return map_DeleteOptions
}
var map_DownwardAPIProjection = map[string]string{
"": "Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.",
"items": "Items is a list of DownwardAPIVolume file",
}
func (DownwardAPIProjection) SwaggerDoc() map[string]string {
return map_DownwardAPIProjection
}
var map_DownwardAPIVolumeFile = map[string]string{
"": "DownwardAPIVolumeFile represents information to create the file containing the pod field",
"path": "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'",
@@ -1420,6 +1439,16 @@ func (Probe) SwaggerDoc() map[string]string {
return map_Probe
}
var map_ProjectedVolumeSource = map[string]string{
"": "Represents a projected volume source",
"sources": "list of volume projections",
"defaultMode": "Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.",
}
func (ProjectedVolumeSource) SwaggerDoc() map[string]string {
return map_ProjectedVolumeSource
}
var map_QuobyteVolumeSource = map[string]string{
"": "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.",
"registry": "Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes",
@@ -1635,6 +1664,16 @@ func (SecretList) SwaggerDoc() map[string]string {
return map_SecretList
}
var map_SecretProjection = map[string]string{
"": "Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.",
"items": "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.",
"optional": "Specify whether the Secret or its key must be defined",
}
func (SecretProjection) SwaggerDoc() map[string]string {
return map_SecretProjection
}
var map_SecretVolumeSource = map[string]string{
"": "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.",
"secretName": "Name of the secret in the pod's namespace to use. More info: http://kubernetes.io/docs/user-guide/volumes#secrets",
@@ -1817,6 +1856,17 @@ func (VolumeMount) SwaggerDoc() map[string]string {
return map_VolumeMount
}
var map_VolumeProjection = map[string]string{
"": "Projection that may be projected along with other supported volume types",
"secret": "information about the secret data to project",
"downwardAPI": "information about the downwardAPI data to project",
"configMap": "information about the configMap data to project",
}
func (VolumeProjection) SwaggerDoc() map[string]string {
return map_VolumeProjection
}
var map_VolumeSource = map[string]string{
"": "Represents the source of a volume to mount. Only one of its members may be specified.",
"hostPath": "HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: http://kubernetes.io/docs/user-guide/volumes#hostpath",
@@ -1842,6 +1892,7 @@ var map_VolumeSource = map[string]string{
"quobyte": "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime",
"azureDisk": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.",
"photonPersistentDisk": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine",
"projected": "Items for all in one resources secrets, configmaps, and downward API",
}
func (VolumeSource) SwaggerDoc() map[string]string {

View File

@@ -71,6 +71,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_api_ConfigMapKeySelector_To_v1_ConfigMapKeySelector,
Convert_v1_ConfigMapList_To_api_ConfigMapList,
Convert_api_ConfigMapList_To_v1_ConfigMapList,
Convert_v1_ConfigMapProjection_To_api_ConfigMapProjection,
Convert_api_ConfigMapProjection_To_v1_ConfigMapProjection,
Convert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource,
Convert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource,
Convert_v1_Container_To_api_Container,
@@ -93,6 +95,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_api_DaemonEndpoint_To_v1_DaemonEndpoint,
Convert_v1_DeleteOptions_To_api_DeleteOptions,
Convert_api_DeleteOptions_To_v1_DeleteOptions,
Convert_v1_DownwardAPIProjection_To_api_DownwardAPIProjection,
Convert_api_DownwardAPIProjection_To_v1_DownwardAPIProjection,
Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile,
Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile,
Convert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource,
@@ -279,6 +283,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_api_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm,
Convert_v1_Probe_To_api_Probe,
Convert_api_Probe_To_v1_Probe,
Convert_v1_ProjectedVolumeSource_To_api_ProjectedVolumeSource,
Convert_api_ProjectedVolumeSource_To_v1_ProjectedVolumeSource,
Convert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource,
Convert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource,
Convert_v1_RBDVolumeSource_To_api_RBDVolumeSource,
@@ -317,6 +323,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_api_SecretKeySelector_To_v1_SecretKeySelector,
Convert_v1_SecretList_To_api_SecretList,
Convert_api_SecretList_To_v1_SecretList,
Convert_v1_SecretProjection_To_api_SecretProjection,
Convert_api_SecretProjection_To_v1_SecretProjection,
Convert_v1_SecretVolumeSource_To_api_SecretVolumeSource,
Convert_api_SecretVolumeSource_To_v1_SecretVolumeSource,
Convert_v1_SecurityContext_To_api_SecurityContext,
@@ -351,6 +359,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_api_Volume_To_v1_Volume,
Convert_v1_VolumeMount_To_api_VolumeMount,
Convert_api_VolumeMount_To_v1_VolumeMount,
Convert_v1_VolumeProjection_To_api_VolumeProjection,
Convert_api_VolumeProjection_To_v1_VolumeProjection,
Convert_v1_VolumeSource_To_api_VolumeSource,
Convert_api_VolumeSource_To_v1_VolumeSource,
Convert_v1_VsphereVirtualDiskVolumeSource_To_api_VsphereVirtualDiskVolumeSource,
@@ -740,6 +750,32 @@ func Convert_api_ConfigMapList_To_v1_ConfigMapList(in *api.ConfigMapList, out *C
return autoConvert_api_ConfigMapList_To_v1_ConfigMapList(in, out, s)
}
func autoConvert_v1_ConfigMapProjection_To_api_ConfigMapProjection(in *ConfigMapProjection, out *api.ConfigMapProjection, s conversion.Scope) error {
if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil {
return err
}
out.Items = *(*[]api.KeyToPath)(unsafe.Pointer(&in.Items))
out.Optional = (*bool)(unsafe.Pointer(in.Optional))
return nil
}
func Convert_v1_ConfigMapProjection_To_api_ConfigMapProjection(in *ConfigMapProjection, out *api.ConfigMapProjection, s conversion.Scope) error {
return autoConvert_v1_ConfigMapProjection_To_api_ConfigMapProjection(in, out, s)
}
func autoConvert_api_ConfigMapProjection_To_v1_ConfigMapProjection(in *api.ConfigMapProjection, out *ConfigMapProjection, s conversion.Scope) error {
if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil {
return err
}
out.Items = *(*[]KeyToPath)(unsafe.Pointer(&in.Items))
out.Optional = (*bool)(unsafe.Pointer(in.Optional))
return nil
}
func Convert_api_ConfigMapProjection_To_v1_ConfigMapProjection(in *api.ConfigMapProjection, out *ConfigMapProjection, s conversion.Scope) error {
return autoConvert_api_ConfigMapProjection_To_v1_ConfigMapProjection(in, out, s)
}
func autoConvert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource(in *ConfigMapVolumeSource, out *api.ConfigMapVolumeSource, s conversion.Scope) error {
if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil {
return err
@@ -1044,6 +1080,24 @@ func Convert_api_DeleteOptions_To_v1_DeleteOptions(in *api.DeleteOptions, out *D
return autoConvert_api_DeleteOptions_To_v1_DeleteOptions(in, out, s)
}
func autoConvert_v1_DownwardAPIProjection_To_api_DownwardAPIProjection(in *DownwardAPIProjection, out *api.DownwardAPIProjection, s conversion.Scope) error {
out.Items = *(*[]api.DownwardAPIVolumeFile)(unsafe.Pointer(&in.Items))
return nil
}
func Convert_v1_DownwardAPIProjection_To_api_DownwardAPIProjection(in *DownwardAPIProjection, out *api.DownwardAPIProjection, s conversion.Scope) error {
return autoConvert_v1_DownwardAPIProjection_To_api_DownwardAPIProjection(in, out, s)
}
func autoConvert_api_DownwardAPIProjection_To_v1_DownwardAPIProjection(in *api.DownwardAPIProjection, out *DownwardAPIProjection, s conversion.Scope) error {
out.Items = *(*[]DownwardAPIVolumeFile)(unsafe.Pointer(&in.Items))
return nil
}
func Convert_api_DownwardAPIProjection_To_v1_DownwardAPIProjection(in *api.DownwardAPIProjection, out *DownwardAPIProjection, s conversion.Scope) error {
return autoConvert_api_DownwardAPIProjection_To_v1_DownwardAPIProjection(in, out, s)
}
func autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
out.Path = in.Path
out.FieldRef = (*api.ObjectFieldSelector)(unsafe.Pointer(in.FieldRef))
@@ -3381,6 +3435,26 @@ func Convert_api_Probe_To_v1_Probe(in *api.Probe, out *Probe, s conversion.Scope
return autoConvert_api_Probe_To_v1_Probe(in, out, s)
}
func autoConvert_v1_ProjectedVolumeSource_To_api_ProjectedVolumeSource(in *ProjectedVolumeSource, out *api.ProjectedVolumeSource, s conversion.Scope) error {
out.Sources = *(*[]api.VolumeProjection)(unsafe.Pointer(&in.Sources))
out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode))
return nil
}
func Convert_v1_ProjectedVolumeSource_To_api_ProjectedVolumeSource(in *ProjectedVolumeSource, out *api.ProjectedVolumeSource, s conversion.Scope) error {
return autoConvert_v1_ProjectedVolumeSource_To_api_ProjectedVolumeSource(in, out, s)
}
func autoConvert_api_ProjectedVolumeSource_To_v1_ProjectedVolumeSource(in *api.ProjectedVolumeSource, out *ProjectedVolumeSource, s conversion.Scope) error {
out.Sources = *(*[]VolumeProjection)(unsafe.Pointer(&in.Sources))
out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode))
return nil
}
func Convert_api_ProjectedVolumeSource_To_v1_ProjectedVolumeSource(in *api.ProjectedVolumeSource, out *ProjectedVolumeSource, s conversion.Scope) error {
return autoConvert_api_ProjectedVolumeSource_To_v1_ProjectedVolumeSource(in, out, s)
}
func autoConvert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource(in *QuobyteVolumeSource, out *api.QuobyteVolumeSource, s conversion.Scope) error {
out.Registry = in.Registry
out.Volume = in.Volume
@@ -3886,6 +3960,32 @@ func Convert_api_SecretList_To_v1_SecretList(in *api.SecretList, out *SecretList
return autoConvert_api_SecretList_To_v1_SecretList(in, out, s)
}
func autoConvert_v1_SecretProjection_To_api_SecretProjection(in *SecretProjection, out *api.SecretProjection, s conversion.Scope) error {
if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil {
return err
}
out.Items = *(*[]api.KeyToPath)(unsafe.Pointer(&in.Items))
out.Optional = (*bool)(unsafe.Pointer(in.Optional))
return nil
}
func Convert_v1_SecretProjection_To_api_SecretProjection(in *SecretProjection, out *api.SecretProjection, s conversion.Scope) error {
return autoConvert_v1_SecretProjection_To_api_SecretProjection(in, out, s)
}
func autoConvert_api_SecretProjection_To_v1_SecretProjection(in *api.SecretProjection, out *SecretProjection, s conversion.Scope) error {
if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil {
return err
}
out.Items = *(*[]KeyToPath)(unsafe.Pointer(&in.Items))
out.Optional = (*bool)(unsafe.Pointer(in.Optional))
return nil
}
func Convert_api_SecretProjection_To_v1_SecretProjection(in *api.SecretProjection, out *SecretProjection, s conversion.Scope) error {
return autoConvert_api_SecretProjection_To_v1_SecretProjection(in, out, s)
}
func autoConvert_v1_SecretVolumeSource_To_api_SecretVolumeSource(in *SecretVolumeSource, out *api.SecretVolumeSource, s conversion.Scope) error {
out.SecretName = in.SecretName
out.Items = *(*[]api.KeyToPath)(unsafe.Pointer(&in.Items))
@@ -4303,6 +4403,28 @@ func Convert_api_VolumeMount_To_v1_VolumeMount(in *api.VolumeMount, out *VolumeM
return autoConvert_api_VolumeMount_To_v1_VolumeMount(in, out, s)
}
func autoConvert_v1_VolumeProjection_To_api_VolumeProjection(in *VolumeProjection, out *api.VolumeProjection, s conversion.Scope) error {
out.Secret = (*api.SecretProjection)(unsafe.Pointer(in.Secret))
out.DownwardAPI = (*api.DownwardAPIProjection)(unsafe.Pointer(in.DownwardAPI))
out.ConfigMap = (*api.ConfigMapProjection)(unsafe.Pointer(in.ConfigMap))
return nil
}
func Convert_v1_VolumeProjection_To_api_VolumeProjection(in *VolumeProjection, out *api.VolumeProjection, s conversion.Scope) error {
return autoConvert_v1_VolumeProjection_To_api_VolumeProjection(in, out, s)
}
func autoConvert_api_VolumeProjection_To_v1_VolumeProjection(in *api.VolumeProjection, out *VolumeProjection, s conversion.Scope) error {
out.Secret = (*SecretProjection)(unsafe.Pointer(in.Secret))
out.DownwardAPI = (*DownwardAPIProjection)(unsafe.Pointer(in.DownwardAPI))
out.ConfigMap = (*ConfigMapProjection)(unsafe.Pointer(in.ConfigMap))
return nil
}
func Convert_api_VolumeProjection_To_v1_VolumeProjection(in *api.VolumeProjection, out *VolumeProjection, s conversion.Scope) error {
return autoConvert_api_VolumeProjection_To_v1_VolumeProjection(in, out, s)
}
func autoConvert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.VolumeSource, s conversion.Scope) error {
out.HostPath = (*api.HostPathVolumeSource)(unsafe.Pointer(in.HostPath))
out.EmptyDir = (*api.EmptyDirVolumeSource)(unsafe.Pointer(in.EmptyDir))
@@ -4327,6 +4449,7 @@ func autoConvert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.
out.Quobyte = (*api.QuobyteVolumeSource)(unsafe.Pointer(in.Quobyte))
out.AzureDisk = (*api.AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk))
out.PhotonPersistentDisk = (*api.PhotonPersistentDiskVolumeSource)(unsafe.Pointer(in.PhotonPersistentDisk))
out.Projected = (*api.ProjectedVolumeSource)(unsafe.Pointer(in.Projected))
return nil
}
@@ -4358,6 +4481,7 @@ func autoConvert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out *
out.VsphereVolume = (*VsphereVirtualDiskVolumeSource)(unsafe.Pointer(in.VsphereVolume))
out.AzureDisk = (*AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk))
out.PhotonPersistentDisk = (*PhotonPersistentDiskVolumeSource)(unsafe.Pointer(in.PhotonPersistentDisk))
out.Projected = (*ProjectedVolumeSource)(unsafe.Pointer(in.Projected))
return nil
}

View File

@@ -53,6 +53,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ConfigMapEnvSource, InType: reflect.TypeOf(&ConfigMapEnvSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ConfigMapKeySelector, InType: reflect.TypeOf(&ConfigMapKeySelector{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ConfigMapList, InType: reflect.TypeOf(&ConfigMapList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ConfigMapProjection, InType: reflect.TypeOf(&ConfigMapProjection{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ConfigMapVolumeSource, InType: reflect.TypeOf(&ConfigMapVolumeSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Container, InType: reflect.TypeOf(&Container{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ContainerImage, InType: reflect.TypeOf(&ContainerImage{})},
@@ -64,6 +65,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ContainerStatus, InType: reflect.TypeOf(&ContainerStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_DaemonEndpoint, InType: reflect.TypeOf(&DaemonEndpoint{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_DeleteOptions, InType: reflect.TypeOf(&DeleteOptions{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_DownwardAPIProjection, InType: reflect.TypeOf(&DownwardAPIProjection{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_DownwardAPIVolumeFile, InType: reflect.TypeOf(&DownwardAPIVolumeFile{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_DownwardAPIVolumeSource, InType: reflect.TypeOf(&DownwardAPIVolumeSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EmptyDirVolumeSource, InType: reflect.TypeOf(&EmptyDirVolumeSource{})},
@@ -157,6 +159,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PreferAvoidPodsEntry, InType: reflect.TypeOf(&PreferAvoidPodsEntry{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PreferredSchedulingTerm, InType: reflect.TypeOf(&PreferredSchedulingTerm{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Probe, InType: reflect.TypeOf(&Probe{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ProjectedVolumeSource, InType: reflect.TypeOf(&ProjectedVolumeSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_QuobyteVolumeSource, InType: reflect.TypeOf(&QuobyteVolumeSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RBDVolumeSource, InType: reflect.TypeOf(&RBDVolumeSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RangeAllocation, InType: reflect.TypeOf(&RangeAllocation{})},
@@ -176,6 +179,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretEnvSource, InType: reflect.TypeOf(&SecretEnvSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretKeySelector, InType: reflect.TypeOf(&SecretKeySelector{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretList, InType: reflect.TypeOf(&SecretList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretProjection, InType: reflect.TypeOf(&SecretProjection{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretVolumeSource, InType: reflect.TypeOf(&SecretVolumeSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecurityContext, InType: reflect.TypeOf(&SecurityContext{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SerializedReference, InType: reflect.TypeOf(&SerializedReference{})},
@@ -193,6 +197,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Toleration, InType: reflect.TypeOf(&Toleration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Volume, InType: reflect.TypeOf(&Volume{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_VolumeMount, InType: reflect.TypeOf(&VolumeMount{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_VolumeProjection, InType: reflect.TypeOf(&VolumeProjection{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_VolumeSource, InType: reflect.TypeOf(&VolumeSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_VsphereVirtualDiskVolumeSource, InType: reflect.TypeOf(&VsphereVirtualDiskVolumeSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_WeightedPodAffinityTerm, InType: reflect.TypeOf(&WeightedPodAffinityTerm{})},
@@ -472,6 +477,29 @@ func DeepCopy_v1_ConfigMapList(in interface{}, out interface{}, c *conversion.Cl
}
}
func DeepCopy_v1_ConfigMapProjection(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ConfigMapProjection)
out := out.(*ConfigMapProjection)
*out = *in
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]KeyToPath, len(*in))
for i := range *in {
if err := DeepCopy_v1_KeyToPath(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
}
if in.Optional != nil {
in, out := &in.Optional, &out.Optional
*out = new(bool)
**out = **in
}
return nil
}
}
func DeepCopy_v1_ConfigMapVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ConfigMapVolumeSource)
@@ -709,6 +737,24 @@ func DeepCopy_v1_DeleteOptions(in interface{}, out interface{}, c *conversion.Cl
}
}
func DeepCopy_v1_DownwardAPIProjection(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*DownwardAPIProjection)
out := out.(*DownwardAPIProjection)
*out = *in
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]DownwardAPIVolumeFile, len(*in))
for i := range *in {
if err := DeepCopy_v1_DownwardAPIVolumeFile(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
}
return nil
}
}
func DeepCopy_v1_DownwardAPIVolumeFile(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*DownwardAPIVolumeFile)
@@ -2492,6 +2538,29 @@ func DeepCopy_v1_Probe(in interface{}, out interface{}, c *conversion.Cloner) er
}
}
func DeepCopy_v1_ProjectedVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ProjectedVolumeSource)
out := out.(*ProjectedVolumeSource)
*out = *in
if in.Sources != nil {
in, out := &in.Sources, &out.Sources
*out = make([]VolumeProjection, len(*in))
for i := range *in {
if err := DeepCopy_v1_VolumeProjection(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
}
if in.DefaultMode != nil {
in, out := &in.DefaultMode, &out.DefaultMode
*out = new(int32)
**out = **in
}
return nil
}
}
func DeepCopy_v1_QuobyteVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*QuobyteVolumeSource)
@@ -2835,6 +2904,29 @@ func DeepCopy_v1_SecretList(in interface{}, out interface{}, c *conversion.Clone
}
}
func DeepCopy_v1_SecretProjection(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SecretProjection)
out := out.(*SecretProjection)
*out = *in
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]KeyToPath, len(*in))
for i := range *in {
if err := DeepCopy_v1_KeyToPath(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
}
if in.Optional != nil {
in, out := &in.Optional, &out.Optional
*out = new(bool)
**out = **in
}
return nil
}
}
func DeepCopy_v1_SecretVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SecretVolumeSource)
@@ -3127,6 +3219,36 @@ func DeepCopy_v1_VolumeMount(in interface{}, out interface{}, c *conversion.Clon
}
}
func DeepCopy_v1_VolumeProjection(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*VolumeProjection)
out := out.(*VolumeProjection)
*out = *in
if in.Secret != nil {
in, out := &in.Secret, &out.Secret
*out = new(SecretProjection)
if err := DeepCopy_v1_SecretProjection(*in, *out, c); err != nil {
return err
}
}
if in.DownwardAPI != nil {
in, out := &in.DownwardAPI, &out.DownwardAPI
*out = new(DownwardAPIProjection)
if err := DeepCopy_v1_DownwardAPIProjection(*in, *out, c); err != nil {
return err
}
}
if in.ConfigMap != nil {
in, out := &in.ConfigMap, &out.ConfigMap
*out = new(ConfigMapProjection)
if err := DeepCopy_v1_ConfigMapProjection(*in, *out, c); err != nil {
return err
}
}
return nil
}
}
func DeepCopy_v1_VolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*VolumeSource)
@@ -3265,6 +3387,13 @@ func DeepCopy_v1_VolumeSource(in interface{}, out interface{}, c *conversion.Clo
*out = new(PhotonPersistentDiskVolumeSource)
**out = **in
}
if in.Projected != nil {
in, out := &in.Projected, &out.Projected
*out = new(ProjectedVolumeSource)
if err := DeepCopy_v1_ProjectedVolumeSource(*in, *out, c); err != nil {
return err
}
}
return nil
}
}

View File

@@ -190,6 +190,20 @@ func SetObjectDefaults_Pod(in *Pod) {
if a.VolumeSource.AzureDisk != nil {
SetDefaults_AzureDiskVolumeSource(a.VolumeSource.AzureDisk)
}
if a.VolumeSource.Projected != nil {
SetDefaults_ProjectedVolumeSource(a.VolumeSource.Projected)
for j := range a.VolumeSource.Projected.Sources {
b := &a.VolumeSource.Projected.Sources[j]
if b.DownwardAPI != nil {
for k := range b.DownwardAPI.Items {
c := &b.DownwardAPI.Items[k]
if c.FieldRef != nil {
SetDefaults_ObjectFieldSelector(c.FieldRef)
}
}
}
}
}
}
for i := range in.Spec.InitContainers {
a := &in.Spec.InitContainers[i]
@@ -321,6 +335,20 @@ func SetObjectDefaults_PodTemplate(in *PodTemplate) {
if a.VolumeSource.AzureDisk != nil {
SetDefaults_AzureDiskVolumeSource(a.VolumeSource.AzureDisk)
}
if a.VolumeSource.Projected != nil {
SetDefaults_ProjectedVolumeSource(a.VolumeSource.Projected)
for j := range a.VolumeSource.Projected.Sources {
b := &a.VolumeSource.Projected.Sources[j]
if b.DownwardAPI != nil {
for k := range b.DownwardAPI.Items {
c := &b.DownwardAPI.Items[k]
if c.FieldRef != nil {
SetDefaults_ObjectFieldSelector(c.FieldRef)
}
}
}
}
}
}
for i := range in.Template.Spec.InitContainers {
a := &in.Template.Spec.InitContainers[i]
@@ -446,6 +474,20 @@ func SetObjectDefaults_ReplicationController(in *ReplicationController) {
if a.VolumeSource.AzureDisk != nil {
SetDefaults_AzureDiskVolumeSource(a.VolumeSource.AzureDisk)
}
if a.VolumeSource.Projected != nil {
SetDefaults_ProjectedVolumeSource(a.VolumeSource.Projected)
for j := range a.VolumeSource.Projected.Sources {
b := &a.VolumeSource.Projected.Sources[j]
if b.DownwardAPI != nil {
for k := range b.DownwardAPI.Items {
c := &b.DownwardAPI.Items[k]
if c.FieldRef != nil {
SetDefaults_ObjectFieldSelector(c.FieldRef)
}
}
}
}
}
}
for i := range in.Spec.Template.Spec.InitContainers {
a := &in.Spec.Template.Spec.InitContainers[i]