mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Merge pull request #69988 from bradhoekstra/fix-69445
Set the default for EnableServiceLinks only in Pod
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user