From 1f734228ebafb3da225281099e01a55cfb54d5c1 Mon Sep 17 00:00:00 2001 From: Roman Iuvshyn Date: Thu, 11 Jun 2020 00:48:45 +0300 Subject: [PATCH] fix: fix secret reconciliation (#138) * fix secret reconciliation Only secret Data and Type should be compared during reconciliation otherwise projected and existing secrets will never match due to metadata that contains timestamps. * fixtypo --- pkg/controller/credstashsecret/credstashsecret_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller/credstashsecret/credstashsecret_controller.go b/pkg/controller/credstashsecret/credstashsecret_controller.go index 2d94ce3..0aed199 100644 --- a/pkg/controller/credstashsecret/credstashsecret_controller.go +++ b/pkg/controller/credstashsecret/credstashsecret_controller.go @@ -217,8 +217,8 @@ func (r *ReconcileCredstashSecret) Reconcile(request reconcile.Request) (reconci return reconcile.Result{}, err } - // Secret is out of date with credstash data - if !reflect.DeepEqual(secret, found) { + // Secret data or type is out of date with credstashsecret + if !reflect.DeepEqual(secret.Data, found.Data) || !reflect.DeepEqual(secret.Type, found.Type) { reqLogger.Info( "Updating Secret because contents have changed", "Secret.Namespace",