kubelet: Make service environment variables optional

This commit is contained in:
Brad Hoekstra
2018-09-17 16:27:36 -04:00
parent 690179b122
commit ac8799a80d
43 changed files with 1413 additions and 867 deletions

View File

@@ -37,6 +37,7 @@ func noDefault(*core.Pod) error { return nil }
func TestDecodeSinglePod(t *testing.T) {
grace := int64(30)
enableServiceLinks := core.DefaultEnableServiceLinks
pod := &v1.Pod{
TypeMeta: metav1.TypeMeta{
APIVersion: "",
@@ -58,8 +59,9 @@ func TestDecodeSinglePod(t *testing.T) {
TerminationMessagePolicy: v1.TerminationMessageReadFile,
SecurityContext: securitycontext.ValidSecurityContextWithContainerDefaults(),
}},
SecurityContext: &v1.PodSecurityContext{},
SchedulerName: core.DefaultSchedulerName,
SecurityContext: &v1.PodSecurityContext{},
SchedulerName: core.DefaultSchedulerName,
EnableServiceLinks: &enableServiceLinks,
},
}
json, err := runtime.Encode(testapi.Default.Codec(), pod)
@@ -99,6 +101,7 @@ func TestDecodeSinglePod(t *testing.T) {
func TestDecodePodList(t *testing.T) {
grace := int64(30)
enableServiceLinks := core.DefaultEnableServiceLinks
pod := &v1.Pod{
TypeMeta: metav1.TypeMeta{
APIVersion: "",
@@ -121,8 +124,9 @@ func TestDecodePodList(t *testing.T) {
SecurityContext: securitycontext.ValidSecurityContextWithContainerDefaults(),
}},
SecurityContext: &v1.PodSecurityContext{},
SchedulerName: core.DefaultSchedulerName,
SecurityContext: &v1.PodSecurityContext{},
SchedulerName: core.DefaultSchedulerName,
EnableServiceLinks: &enableServiceLinks,
},
}
podList := &v1.PodList{