mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-25 14:41:53 +00:00
Set defaults for initContainer beta.
Kubernetes-commit: 7b7a759915c515c37455dafa2e98b4d95e6ce6b7
This commit is contained in:
parent
1f311d1b79
commit
ca719949f1
@ -481,10 +481,16 @@ func Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec, out
|
|||||||
in.Spec.InitContainers = values
|
in.Spec.InitContainers = values
|
||||||
|
|
||||||
// Call defaulters explicitly until annotations are removed
|
// Call defaulters explicitly until annotations are removed
|
||||||
for i := range in.Spec.InitContainers {
|
tmpPodTemp := &PodTemplate{
|
||||||
c := &in.Spec.InitContainers[i]
|
Template: PodTemplateSpec{
|
||||||
SetDefaults_Container(c)
|
Spec: PodSpec{
|
||||||
|
HostNetwork: in.Spec.HostNetwork,
|
||||||
|
InitContainers: values,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
SetObjectDefaults_PodTemplate(tmpPodTemp)
|
||||||
|
in.Spec.InitContainers = tmpPodTemp.Template.Spec.InitContainers
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := autoConvert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in, out, s); err != nil {
|
if err := autoConvert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in, out, s); err != nil {
|
||||||
@ -604,10 +610,14 @@ func Convert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error
|
|||||||
// back to the caller.
|
// back to the caller.
|
||||||
in.Spec.InitContainers = values
|
in.Spec.InitContainers = values
|
||||||
// Call defaulters explicitly until annotations are removed
|
// Call defaulters explicitly until annotations are removed
|
||||||
for i := range in.Spec.InitContainers {
|
tmpPod := &Pod{
|
||||||
c := &in.Spec.InitContainers[i]
|
Spec: PodSpec{
|
||||||
SetDefaults_Container(c)
|
HostNetwork: in.Spec.HostNetwork,
|
||||||
|
InitContainers: values,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
SetObjectDefaults_Pod(tmpPod)
|
||||||
|
in.Spec.InitContainers = tmpPod.Spec.InitContainers
|
||||||
}
|
}
|
||||||
// If there is a beta annotation, copy to alpha key.
|
// If there is a beta annotation, copy to alpha key.
|
||||||
// See commit log for PR #31026 for why we do this.
|
// See commit log for PR #31026 for why we do this.
|
||||||
|
Loading…
Reference in New Issue
Block a user