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

@@ -40,6 +40,7 @@ import (
func TestSetDefaultDaemonSetSpec(t *testing.T) {
defaultLabels := map[string]string{"foo": "bar"}
period := int64(v1.DefaultTerminationGracePeriodSeconds)
enableServiceLinks := api.DefaultEnableServiceLinks
defaultTemplate := v1.PodTemplateSpec{
Spec: v1.PodSpec{
DNSPolicy: v1.DNSClusterFirst,
@@ -47,6 +48,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
SecurityContext: &v1.PodSecurityContext{},
TerminationGracePeriodSeconds: &period,
SchedulerName: api.DefaultSchedulerName,
EnableServiceLinks: &enableServiceLinks,
},
ObjectMeta: metav1.ObjectMeta{
Labels: defaultLabels,
@@ -59,6 +61,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
SecurityContext: &v1.PodSecurityContext{},
TerminationGracePeriodSeconds: &period,
SchedulerName: api.DefaultSchedulerName,
EnableServiceLinks: &enableServiceLinks,
},
}
tests := []struct {
@@ -164,6 +167,7 @@ func TestSetDefaultDeployment(t *testing.T) {
defaultIntOrString := intstr.FromInt(1)
differentIntOrString := intstr.FromInt(5)
period := int64(v1.DefaultTerminationGracePeriodSeconds)
enableServiceLinks := api.DefaultEnableServiceLinks
defaultTemplate := v1.PodTemplateSpec{
Spec: v1.PodSpec{
DNSPolicy: v1.DNSClusterFirst,
@@ -171,6 +175,7 @@ func TestSetDefaultDeployment(t *testing.T) {
SecurityContext: &v1.PodSecurityContext{},
TerminationGracePeriodSeconds: &period,
SchedulerName: api.DefaultSchedulerName,
EnableServiceLinks: &enableServiceLinks,
},
}
tests := []struct {