2017-03-01 19:00:57 +00:00
|
|
|
// +build !ignore_autogenerated
|
|
|
|
|
|
|
|
/*
|
2018-01-22 12:37:53 +00:00
|
|
|
Copyright The Kubernetes Authors.
|
2017-03-01 19:00:57 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2018-02-27 01:16:14 +00:00
|
|
|
// Code generated by defaulter-gen. DO NOT EDIT.
|
2017-03-01 19:00:57 +00:00
|
|
|
|
|
|
|
package v1alpha1
|
|
|
|
|
|
|
|
import (
|
2017-06-22 18:09:08 +00:00
|
|
|
v1alpha1 "k8s.io/api/settings/v1alpha1"
|
2017-03-01 19:00:57 +00:00
|
|
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
2017-11-08 22:34:54 +00:00
|
|
|
v1 "k8s.io/kubernetes/pkg/apis/core/v1"
|
2017-03-01 19:00:57 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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 {
|
2017-06-22 18:09:08 +00:00
|
|
|
scheme.AddTypeDefaultingFunc(&v1alpha1.PodPreset{}, func(obj interface{}) { SetObjectDefaults_PodPreset(obj.(*v1alpha1.PodPreset)) })
|
|
|
|
scheme.AddTypeDefaultingFunc(&v1alpha1.PodPresetList{}, func(obj interface{}) { SetObjectDefaults_PodPresetList(obj.(*v1alpha1.PodPresetList)) })
|
2017-03-01 19:00:57 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2017-06-22 18:09:08 +00:00
|
|
|
func SetObjectDefaults_PodPreset(in *v1alpha1.PodPreset) {
|
2017-03-01 19:00:57 +00:00
|
|
|
for i := range in.Spec.Env {
|
|
|
|
a := &in.Spec.Env[i]
|
|
|
|
if a.ValueFrom != nil {
|
|
|
|
if a.ValueFrom.FieldRef != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_ObjectFieldSelector(a.ValueFrom.FieldRef)
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for i := range in.Spec.Volumes {
|
|
|
|
a := &in.Spec.Volumes[i]
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_Volume(a)
|
2017-08-23 07:23:34 +00:00
|
|
|
if a.VolumeSource.HostPath != nil {
|
|
|
|
v1.SetDefaults_HostPathVolumeSource(a.VolumeSource.HostPath)
|
|
|
|
}
|
2017-03-01 19:00:57 +00:00
|
|
|
if a.VolumeSource.Secret != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_SecretVolumeSource(a.VolumeSource.Secret)
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
if a.VolumeSource.ISCSI != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_ISCSIVolumeSource(a.VolumeSource.ISCSI)
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
if a.VolumeSource.RBD != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_RBDVolumeSource(a.VolumeSource.RBD)
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
if a.VolumeSource.DownwardAPI != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_DownwardAPIVolumeSource(a.VolumeSource.DownwardAPI)
|
2017-03-01 19:00:57 +00:00
|
|
|
for j := range a.VolumeSource.DownwardAPI.Items {
|
|
|
|
b := &a.VolumeSource.DownwardAPI.Items[j]
|
|
|
|
if b.FieldRef != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_ObjectFieldSelector(b.FieldRef)
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if a.VolumeSource.ConfigMap != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_ConfigMapVolumeSource(a.VolumeSource.ConfigMap)
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
if a.VolumeSource.AzureDisk != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_AzureDiskVolumeSource(a.VolumeSource.AzureDisk)
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
if a.VolumeSource.Projected != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_ProjectedVolumeSource(a.VolumeSource.Projected)
|
2017-03-01 19:00:57 +00:00
|
|
|
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 {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_ObjectFieldSelector(c.FieldRef)
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-05-15 01:56:36 +00:00
|
|
|
if b.ServiceAccountToken != nil {
|
|
|
|
v1.SetDefaults_ServiceAccountTokenProjection(b.ServiceAccountToken)
|
|
|
|
}
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
}
|
2016-11-19 20:46:23 +00:00
|
|
|
if a.VolumeSource.ScaleIO != nil {
|
2017-06-22 18:09:08 +00:00
|
|
|
v1.SetDefaults_ScaleIOVolumeSource(a.VolumeSource.ScaleIO)
|
2016-11-19 20:46:23 +00:00
|
|
|
}
|
2017-03-01 19:00:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-22 18:09:08 +00:00
|
|
|
func SetObjectDefaults_PodPresetList(in *v1alpha1.PodPresetList) {
|
2017-03-01 19:00:57 +00:00
|
|
|
for i := range in.Items {
|
|
|
|
a := &in.Items[i]
|
|
|
|
SetObjectDefaults_PodPreset(a)
|
|
|
|
}
|
|
|
|
}
|