mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-15 20:37:39 +00:00
kubelet: Make service environment variables optional
This commit is contained in:
@@ -61,6 +61,7 @@ func newStorage(t *testing.T) (*REST, *BindingREST, *StatusREST, *etcdtesting.Et
|
||||
|
||||
func validNewPod() *api.Pod {
|
||||
grace := int64(30)
|
||||
enableServiceLinks := api.DefaultEnableServiceLinks
|
||||
return &api.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "foo",
|
||||
@@ -82,8 +83,9 @@ func validNewPod() *api.Pod {
|
||||
SecurityContext: securitycontext.ValidInternalSecurityContextWithContainerDefaults(),
|
||||
},
|
||||
},
|
||||
SecurityContext: &api.PodSecurityContext{},
|
||||
SchedulerName: api.DefaultSchedulerName,
|
||||
SecurityContext: &api.PodSecurityContext{},
|
||||
SchedulerName: api.DefaultSchedulerName,
|
||||
EnableServiceLinks: &enableServiceLinks,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -832,6 +834,7 @@ func TestEtcdUpdateScheduled(t *testing.T) {
|
||||
}
|
||||
|
||||
grace := int64(30)
|
||||
enableServiceLinks := api.DefaultEnableServiceLinks
|
||||
podIn := api.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "foo",
|
||||
@@ -855,6 +858,7 @@ func TestEtcdUpdateScheduled(t *testing.T) {
|
||||
TerminationGracePeriodSeconds: &grace,
|
||||
SecurityContext: &api.PodSecurityContext{},
|
||||
SchedulerName: api.DefaultSchedulerName,
|
||||
EnableServiceLinks: &enableServiceLinks,
|
||||
},
|
||||
}
|
||||
_, _, err = storage.Update(ctx, podIn.Name, rest.DefaultUpdatedObjectInfo(&podIn), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{})
|
||||
@@ -932,9 +936,11 @@ func TestEtcdUpdateStatus(t *testing.T) {
|
||||
expected := podStart
|
||||
expected.ResourceVersion = "2"
|
||||
grace := int64(30)
|
||||
enableServiceLinks := api.DefaultEnableServiceLinks
|
||||
expected.Spec.TerminationGracePeriodSeconds = &grace
|
||||
expected.Spec.RestartPolicy = api.RestartPolicyAlways
|
||||
expected.Spec.DNSPolicy = api.DNSClusterFirst
|
||||
expected.Spec.EnableServiceLinks = &enableServiceLinks
|
||||
expected.Spec.Containers[0].ImagePullPolicy = api.PullIfNotPresent
|
||||
expected.Spec.Containers[0].TerminationMessagePath = api.TerminationMessagePathDefault
|
||||
expected.Spec.Containers[0].TerminationMessagePolicy = api.TerminationMessageReadFile
|
||||
|
||||
Reference in New Issue
Block a user