From 51cfee77fa162b4f9d8aaf1e0708de59585c88f0 Mon Sep 17 00:00:00 2001 From: Leonardo Milleri Date: Wed, 3 Jul 2024 17:48:04 +0100 Subject: [PATCH] Fix add new secret to trustee This operation is now possible after trustee deployment Signed-off-by: Leonardo Milleri --- internal/controller/kbsconfig_controller.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/controller/kbsconfig_controller.go b/internal/controller/kbsconfig_controller.go index 029ea3d..524b4c2 100644 --- a/internal/controller/kbsconfig_controller.go +++ b/internal/controller/kbsconfig_controller.go @@ -622,8 +622,16 @@ func (r *KbsConfigReconciler) isHttpsConfigPresent() bool { // updateKbsDeployment updates an existing deployment for the KBS instance // Errors are logged by the callee and hence no error is logged in this method func (r *KbsConfigReconciler) updateKbsDeployment(ctx context.Context, deployment *appsv1.Deployment) error { + // re-generates the deployment + newDeployment, err := r.newKbsDeployment(ctx) + if err != nil { + return err + } + + // overwrites the template spec, if any changes + deployment.Spec.Template.Spec = *newDeployment.Spec.Template.Spec.DeepCopy() - err := r.Client.Update(ctx, deployment) + err = r.Client.Update(ctx, deployment) if err != nil { return err } else {