From f69593a9ebbd8cc1f27c2b23a43fa72d7029da15 Mon Sep 17 00:00:00 2001 From: Milad Ibra Date: Mon, 12 Jun 2023 16:40:01 +0330 Subject: [PATCH] fix: check port change to reflect changes in underlying service --- controllers/externalservice_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/externalservice_controller.go b/controllers/externalservice_controller.go index afc23c6..7a45a81 100644 --- a/controllers/externalservice_controller.go +++ b/controllers/externalservice_controller.go @@ -104,7 +104,8 @@ func (r *ExternalServiceReconciler) Reconcile(ctx context.Context, req ctrl.Requ // TODO: DeepEqual function does not operate good for this part because kubernetes adds values to fields after creation // we can check for more field differences here. if !reflect.DeepEqual(&desiredService.Spec.Type, ¤tService.Spec.Type) || - !reflect.DeepEqual(&desiredService.Labels, ¤tService.Labels) { + !reflect.DeepEqual(&desiredService.Labels, ¤tService.Labels) || + !reflect.DeepEqual(&desiredService.Spec.Ports, ¤tService.Spec.Ports) { err = r.Update(ctx, &desiredService) if err != nil { logger.Error(err, "could not update service object")