Merge pull request #69988 from bradhoekstra/fix-69445

Set the default for EnableServiceLinks only in Pod
This commit is contained in:
k8s-ci-robot
2018-10-22 19:44:20 -07:00
committed by GitHub
6 changed files with 8 additions and 29 deletions

View File

@@ -160,8 +160,16 @@ func SetDefaults_Pod(obj *v1.Pod) {
}
}
}
if obj.Spec.EnableServiceLinks == nil {
enableServiceLinks := v1.DefaultEnableServiceLinks
obj.Spec.EnableServiceLinks = &enableServiceLinks
}
}
func SetDefaults_PodSpec(obj *v1.PodSpec) {
// New fields added here will break upgrade tests:
// https://github.com/kubernetes/kubernetes/issues/69445
// In most cases the new defaulted field can added to SetDefaults_Pod instead of here, so
// that it only materializes in the Pod object and not all objects with a PodSpec field.
if obj.DNSPolicy == "" {
obj.DNSPolicy = v1.DNSClusterFirst
}
@@ -182,10 +190,6 @@ func SetDefaults_PodSpec(obj *v1.PodSpec) {
if obj.SchedulerName == "" {
obj.SchedulerName = v1.DefaultSchedulerName
}
if obj.EnableServiceLinks == nil {
enableServiceLinks := v1.DefaultEnableServiceLinks
obj.EnableServiceLinks = &enableServiceLinks
}
}
func SetDefaults_Probe(obj *v1.Probe) {
if obj.TimeoutSeconds == 0 {