From aa88a63cd6e148571cde9fd4d735babe6b734713 Mon Sep 17 00:00:00 2001 From: "Zhipeng (David) Tan" Date: Fri, 6 Jun 2025 15:32:09 +0000 Subject: [PATCH 1/2] Fix for the coredns configmap update: the corefile was not updated, even though a different cache size is set up in the test parameters. --- dns/py/params.py | 6 +++++- dns/py/runner.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dns/py/params.py b/dns/py/params.py index 872931842e..facda56d53 100644 --- a/dns/py/params.py +++ b/dns/py/params.py @@ -160,7 +160,11 @@ def is_relevant(self, attributes): def set(self, inputs, value): if value > 0: cf = inputs.configmap_yaml['data']['Corefile'] - cfList = cf.decode().split("\n") + # fix the cf type so that it works also for python3 + if(type(cf) == str): + cfList = cf.split("\n") + else: + cfList = cf.decode().split("\n") cfList.insert(1, " cache {\n" " success " + repr(value) + "\n" diff --git a/dns/py/runner.py b/dns/py/runner.py index ffdefb70cc..06878d4d86 100644 --- a/dns/py/runner.py +++ b/dns/py/runner.py @@ -124,7 +124,7 @@ def go(self): self._create(inputs.deployment_yaml) self._create(self.service_yaml) if self.configmap_yaml is not None: - self._create(self.configmap_yaml) + self._create(inputs.configmap_yaml) self._wait_for_status(True) test_threads=[] #Spawn off a thread to run the test case in each client pod simultaneously. From d2bd70251b5e54680ccbc16059a43eeefc77a707 Mon Sep 17 00:00:00 2001 From: "Zhipeng (David) Tan" Date: Tue, 26 Aug 2025 09:05:14 +0000 Subject: [PATCH 2/2] deprecate python2 support --- dns/py/params.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dns/py/params.py b/dns/py/params.py index facda56d53..2431b9795f 100644 --- a/dns/py/params.py +++ b/dns/py/params.py @@ -160,11 +160,7 @@ def is_relevant(self, attributes): def set(self, inputs, value): if value > 0: cf = inputs.configmap_yaml['data']['Corefile'] - # fix the cf type so that it works also for python3 - if(type(cf) == str): - cfList = cf.split("\n") - else: - cfList = cf.decode().split("\n") + cfList = cf.split("\n") cfList.insert(1, " cache {\n" " success " + repr(value) + "\n"