From 87651b431bfecbf7cce5acfb4ce12fc7c813b201 Mon Sep 17 00:00:00 2001 From: Jesper Ekhall Date: Thu, 4 Apr 2024 16:31:35 +0200 Subject: [PATCH] Set enableServiceLinks to True by default. --- k8s/models/pod.py | 2 +- tests/k8s/test_pod.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/k8s/models/pod.py b/k8s/models/pod.py index b4e1722..3fe4863 100644 --- a/k8s/models/pod.py +++ b/k8s/models/pod.py @@ -216,7 +216,7 @@ class PodSpec(Model): automountServiceAccountToken = Field(bool) imagePullSecrets = ListField(LocalObjectReference) initContainers = ListField(Container) - enableServiceLinks = Field(bool) + enableServiceLinks = Field(bool, True) class PodTemplateSpec(Model): diff --git a/tests/k8s/test_pod.py b/tests/k8s/test_pod.py index 790bb06..f146579 100644 --- a/tests/k8s/test_pod.py +++ b/tests/k8s/test_pod.py @@ -122,6 +122,8 @@ def test_get_or_create_pod_not_new(self, put, get): call_params = pod.as_dict() put.return_value.json.return_value = call_params + assert pod.spec.enableServiceLinks is True + pod.save() pytest.helpers.assert_any_call(put, POD_URI + NAME, call_params)