Skip to content

Commit 170dcc2

Browse files
authored
Merge pull request #68754 from bradhoekstra/optional-service-env-variables
kubelet: Make service environment variables optional
2 parents 7ffaa2f + a596030 commit 170dcc2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1425
-879
lines changed

api/openapi-spec/swagger.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/apps_v1.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/apps_v1beta1.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/apps_v1beta2.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/batch_v1.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/batch_v1beta1.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/batch_v2alpha1.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/extensions_v1beta1.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/v1.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-reference/apps/v1/definitions.html

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-reference/apps/v1beta1/definitions.html

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-reference/apps/v1beta2/definitions.html

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-reference/batch/v1/definitions.html

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-reference/batch/v1beta1/definitions.html

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-reference/batch/v2alpha1/definitions.html

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-reference/extensions/v1beta1/definitions.html

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-reference/v1/definitions.html

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/testing/pod_specs.go

+4
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,26 @@ import (
2424
// DeepEqualSafePodSpec returns a PodSpec which is ready to be used with apiequality.Semantic.DeepEqual
2525
func DeepEqualSafePodSpec() api.PodSpec {
2626
grace := int64(30)
27+
enableServiceLinks := v1.DefaultEnableServiceLinks
2728
return api.PodSpec{
2829
RestartPolicy: api.RestartPolicyAlways,
2930
DNSPolicy: api.DNSClusterFirst,
3031
TerminationGracePeriodSeconds: &grace,
3132
SecurityContext: &api.PodSecurityContext{},
3233
SchedulerName: api.DefaultSchedulerName,
34+
EnableServiceLinks: &enableServiceLinks,
3335
}
3436
}
3537

3638
// V1DeepEqualSafePodSpec returns a PodSpec which is ready to be used with apiequality.Semantic.DeepEqual
3739
func V1DeepEqualSafePodSpec() v1.PodSpec {
3840
grace := int64(30)
41+
enableServiceLinks := v1.DefaultEnableServiceLinks
3942
return v1.PodSpec{
4043
RestartPolicy: v1.RestartPolicyAlways,
4144
DNSPolicy: v1.DNSClusterFirst,
4245
TerminationGracePeriodSeconds: &grace,
4346
SecurityContext: &v1.PodSecurityContext{},
47+
EnableServiceLinks: &enableServiceLinks,
4448
}
4549
}

pkg/api/testing/serialization_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ func TestRoundTripTypes(t *testing.T) {
214214
// decoded without information loss or mutation.
215215
func TestEncodePtr(t *testing.T) {
216216
grace := int64(30)
217+
enableServiceLinks := v1.DefaultEnableServiceLinks
217218
pod := &api.Pod{
218219
ObjectMeta: metav1.ObjectMeta{
219220
Labels: map[string]string{"name": "foo"},
@@ -224,8 +225,9 @@ func TestEncodePtr(t *testing.T) {
224225

225226
TerminationGracePeriodSeconds: &grace,
226227

227-
SecurityContext: &api.PodSecurityContext{},
228-
SchedulerName: api.DefaultSchedulerName,
228+
SecurityContext: &api.PodSecurityContext{},
229+
SchedulerName: api.DefaultSchedulerName,
230+
EnableServiceLinks: &enableServiceLinks,
229231
},
230232
}
231233
obj := runtime.Object(pod)

pkg/apis/apps/v1/defaults_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
3939
defaultLabels := map[string]string{"foo": "bar"}
4040
maxUnavailable := intstr.FromInt(1)
4141
period := int64(v1.DefaultTerminationGracePeriodSeconds)
42+
enableServiceLinks := v1.DefaultEnableServiceLinks
4243
defaultTemplate := v1.PodTemplateSpec{
4344
Spec: v1.PodSpec{
4445
DNSPolicy: v1.DNSClusterFirst,
4546
RestartPolicy: v1.RestartPolicyAlways,
4647
SecurityContext: &v1.PodSecurityContext{},
4748
TerminationGracePeriodSeconds: &period,
4849
SchedulerName: api.DefaultSchedulerName,
50+
EnableServiceLinks: &enableServiceLinks,
4951
},
5052
ObjectMeta: metav1.ObjectMeta{
5153
Labels: defaultLabels,
@@ -58,6 +60,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
5860
SecurityContext: &v1.PodSecurityContext{},
5961
TerminationGracePeriodSeconds: &period,
6062
SchedulerName: api.DefaultSchedulerName,
63+
EnableServiceLinks: &enableServiceLinks,
6164
},
6265
}
6366
tests := []struct {
@@ -175,13 +178,15 @@ func TestSetDefaultStatefulSet(t *testing.T) {
175178
var defaultReplicas int32 = 1
176179

177180
period := int64(v1.DefaultTerminationGracePeriodSeconds)
181+
enableServiceLinks := v1.DefaultEnableServiceLinks
178182
defaultTemplate := v1.PodTemplateSpec{
179183
Spec: v1.PodSpec{
180184
DNSPolicy: v1.DNSClusterFirst,
181185
RestartPolicy: v1.RestartPolicyAlways,
182186
SecurityContext: &v1.PodSecurityContext{},
183187
TerminationGracePeriodSeconds: &period,
184188
SchedulerName: api.DefaultSchedulerName,
189+
EnableServiceLinks: &enableServiceLinks,
185190
},
186191
ObjectMeta: metav1.ObjectMeta{
187192
Labels: defaultLabels,
@@ -286,13 +291,15 @@ func TestSetDefaultDeployment(t *testing.T) {
286291
defaultIntOrString := intstr.FromString("25%")
287292
differentIntOrString := intstr.FromInt(5)
288293
period := int64(v1.DefaultTerminationGracePeriodSeconds)
294+
enableServiceLinks := v1.DefaultEnableServiceLinks
289295
defaultTemplate := v1.PodTemplateSpec{
290296
Spec: v1.PodSpec{
291297
DNSPolicy: v1.DNSClusterFirst,
292298
RestartPolicy: v1.RestartPolicyAlways,
293299
SecurityContext: &v1.PodSecurityContext{},
294300
TerminationGracePeriodSeconds: &period,
295301
SchedulerName: api.DefaultSchedulerName,
302+
EnableServiceLinks: &enableServiceLinks,
296303
},
297304
}
298305
tests := []struct {

pkg/apis/apps/v1beta1/defaults_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ func TestSetDefaultDeployment(t *testing.T) {
3838
defaultIntOrString := intstr.FromString("25%")
3939
differentIntOrString := intstr.FromInt(5)
4040
period := int64(v1.DefaultTerminationGracePeriodSeconds)
41+
enableServiceLinks := v1.DefaultEnableServiceLinks
4142
defaultTemplate := v1.PodTemplateSpec{
4243
Spec: v1.PodSpec{
4344
DNSPolicy: v1.DNSClusterFirst,
4445
RestartPolicy: v1.RestartPolicyAlways,
4546
SecurityContext: &v1.PodSecurityContext{},
4647
TerminationGracePeriodSeconds: &period,
4748
SchedulerName: api.DefaultSchedulerName,
49+
EnableServiceLinks: &enableServiceLinks,
4850
},
4951
}
5052
tests := []struct {

0 commit comments

Comments
 (0)