From 0807419109451555e63001b72640e1c9ecc5db40 Mon Sep 17 00:00:00 2001 From: Michael Pleshakov Date: Fri, 2 Dec 2016 21:59:10 +0300 Subject: [PATCH] Fix overwriting of secrets from different namespaces --- nginx-controller/nginx/configurator.go | 3 ++- nginx-plus-controller/nginx/configurator.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nginx-controller/nginx/configurator.go b/nginx-controller/nginx/configurator.go index e266b6b077..377381110c 100644 --- a/nginx-controller/nginx/configurator.go +++ b/nginx-controller/nginx/configurator.go @@ -66,7 +66,8 @@ func (cnf *Configurator) updateCertificates(ingEx *IngressEx) map[string]string continue } - pemFileName := cnf.nginx.AddOrUpdateCertAndKey(secretName, string(cert), string(key)) + name := ingEx.Ingress.Namespace + "-" + secretName + pemFileName := cnf.nginx.AddOrUpdateCertAndKey(name, string(cert), string(key)) for _, host := range tls.Hosts { pems[host] = pemFileName diff --git a/nginx-plus-controller/nginx/configurator.go b/nginx-plus-controller/nginx/configurator.go index c4c8663d12..bc36d91600 100644 --- a/nginx-plus-controller/nginx/configurator.go +++ b/nginx-plus-controller/nginx/configurator.go @@ -68,7 +68,8 @@ func (cnf *Configurator) updateCertificates(ingEx *IngressEx) map[string]string continue } - pemFileName := cnf.nginx.AddOrUpdateCertAndKey(secretName, string(cert), string(key)) + name := ingEx.Ingress.Namespace + "-" + secretName + pemFileName := cnf.nginx.AddOrUpdateCertAndKey(name, string(cert), string(key)) for _, host := range tls.Hosts { pems[host] = pemFileName