From ee079f4740d93bfd73b8d39c1d56cbb4059d6269 Mon Sep 17 00:00:00 2001 From: Nicolas Goudry Date: Thu, 24 Feb 2022 10:01:33 +0100 Subject: [PATCH] fix(coredns): make sure to keep coredns repository namespace (#8572) fix: regex fix: wrong regex_replace usage --- roles/download/templates/kubeadm-images.yaml.j2 | 2 +- .../control-plane/templates/kubeadm-config.v1beta2.yaml.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/download/templates/kubeadm-images.yaml.j2 b/roles/download/templates/kubeadm-images.yaml.j2 index 565533087..c2068d2fc 100644 --- a/roles/download/templates/kubeadm-images.yaml.j2 +++ b/roles/download/templates/kubeadm-images.yaml.j2 @@ -21,5 +21,5 @@ etcd: {% endif %} dns: type: CoreDNS - imageRepository: {{ coredns_image_repo | regex_replace('/coredns.*$','') }} + imageRepository: {{ coredns_image_repo | regex_replace('/coredns(?!/coredns).*$','') }} imageTag: {{ coredns_image_tag }} diff --git a/roles/kubernetes/control-plane/templates/kubeadm-config.v1beta2.yaml.j2 b/roles/kubernetes/control-plane/templates/kubeadm-config.v1beta2.yaml.j2 index c329fcabe..001a399ea 100644 --- a/roles/kubernetes/control-plane/templates/kubeadm-config.v1beta2.yaml.j2 +++ b/roles/kubernetes/control-plane/templates/kubeadm-config.v1beta2.yaml.j2 @@ -84,7 +84,7 @@ etcd: {% endif %} dns: type: CoreDNS - imageRepository: {{ coredns_image_repo | regex_replace('/coredns.*$','') }} + imageRepository: {{ coredns_image_repo | regex_replace('/coredns(?!/coredns).*$','') }} imageTag: {{ coredns_image_tag }} networking: dnsDomain: {{ dns_domain }}