From 32fe7f92ef18e376779857b992da5e0a5b2bfaca Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Tue, 29 Oct 2024 14:34:55 +0100 Subject: [PATCH 01/12] Unit test verifying that the external service has the default clusterIP type --- pkg/controller/elasticsearch/services/services_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/controller/elasticsearch/services/services_test.go b/pkg/controller/elasticsearch/services/services_test.go index ccbde26fc2..683cebcbcc 100644 --- a/pkg/controller/elasticsearch/services/services_test.go +++ b/pkg/controller/elasticsearch/services/services_test.go @@ -68,6 +68,10 @@ func TestNewExternalService(t *testing.T) { httpConf commonv1.HTTPConfig wantSvc func() corev1.Service }{ + { + name: "default clusterIP service", + wantSvc: mkHTTPService, + }, { name: "no TLS", httpConf: commonv1.HTTPConfig{ @@ -171,9 +175,10 @@ func mkHTTPService() corev1.Service { }, }, Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeClusterIP, Ports: []corev1.ServicePort{ { - Name: "http", + Name: "https", Protocol: corev1.ProtocolTCP, Port: network.HTTPPort, }, From 5b63694b80015086097e16050c14e0b9e6fd459f Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Tue, 29 Oct 2024 14:36:31 +0100 Subject: [PATCH 02/12] Update NewExternalService with default ClusterIP if type not set --- pkg/controller/elasticsearch/services/services.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/controller/elasticsearch/services/services.go b/pkg/controller/elasticsearch/services/services.go index 71284a22bb..81df29e527 100644 --- a/pkg/controller/elasticsearch/services/services.go +++ b/pkg/controller/elasticsearch/services/services.go @@ -112,6 +112,11 @@ func NewExternalService(es esv1.Elasticsearch) *corev1.Service { }, } + // defaults to ClusterIP if not set + if es.Spec.HTTP.Service.Spec.Type == "" { + svc.Spec.Type = corev1.ServiceTypeClusterIP + } + return defaults.SetServiceDefaults(&svc, labels, labels, ports) } From d692c829963e0f412fc1318e4e61c25edd6801b7 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Tue, 29 Oct 2024 20:11:43 +0100 Subject: [PATCH 03/12] Unit test verifying that a services needs to be recreated to go from LoadBalancer type to ClusterIP --- pkg/controller/common/service_control_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/controller/common/service_control_test.go b/pkg/controller/common/service_control_test.go index 6404017907..cb70e37d74 100644 --- a/pkg/controller/common/service_control_test.go +++ b/pkg/controller/common/service_control_test.go @@ -275,6 +275,18 @@ func Test_needsRecreate(t *testing.T) { }, want: true, }, + { + name: "Needs recreate to go from LoadBalancer type to ClusterIP", + args: args{ + expected: corev1.Service{Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeClusterIP, + }}, + reconciled: corev1.Service{Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeLoadBalancer, + }}, + }, + want: true, + }, { name: "Removing the load balancer class is OK if target type is no longer LoadBalancer", args: args{ From d95f488fe32812e2cda6654b75dbd4cc7dc0e457 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Tue, 29 Oct 2024 20:12:25 +0100 Subject: [PATCH 04/12] Shortcut applyServerSideValues when the service type has changed --- pkg/controller/common/service_control.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/controller/common/service_control.go b/pkg/controller/common/service_control.go index 551552b239..859aa7da77 100644 --- a/pkg/controller/common/service_control.go +++ b/pkg/controller/common/service_control.go @@ -88,6 +88,11 @@ func needsUpdate(expected *corev1.Service, reconciled *corev1.Service) bool { // applyServerSideValues applies any default that may have been set from the reconciled version. func applyServerSideValues(expected, reconciled *corev1.Service) { + // shortcut if the service type has changed + if expected.Spec.Type != reconciled.Spec.Type { + return + } + // Type may be defaulted by the api server if expected.Spec.Type == "" { expected.Spec.Type = reconciled.Spec.Type From 1dbb757278e07f4f74446691df523125073e306e Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Tue, 29 Oct 2024 20:14:50 +0100 Subject: [PATCH 05/12] Skip reconciliation if resource is being deleted --- pkg/controller/common/reconciler/reconciler.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/controller/common/reconciler/reconciler.go b/pkg/controller/common/reconciler/reconciler.go index 9435e2011c..ea4a822078 100644 --- a/pkg/controller/common/reconciler/reconciler.go +++ b/pkg/controller/common/reconciler/reconciler.go @@ -90,6 +90,16 @@ func ReconcileResource(params Params) error { log := ulog.FromContext(params.Context).WithValues("kind", kind, "namespace", namespace, "name", name) create := func() error { + // check if not being deleted + err = params.Client.Get(params.Context, types.NamespacedName{Name: name, Namespace: namespace}, params.Reconciled) + if err != nil && !apierrors.IsNotFound(err) { + return err + } + if !params.Reconciled.GetDeletionTimestamp().IsZero() { + log.Info("Waiting for resource to be created because the old one is being deleted") + return nil + } + log.Info("Creating resource") if params.PreCreate != nil { if err := params.PreCreate(); err != nil { @@ -121,6 +131,12 @@ func ReconcileResource(params Params) error { return fmt.Errorf("failed to get %s %s/%s: %w", kind, namespace, name, err) } + // shortcut if being deleted + if !params.Reconciled.GetDeletionTimestamp().IsZero() { + log.Info("Skip reconciliation because the resource is being deleted") + return nil + } + if params.NeedsRecreate != nil && params.NeedsRecreate() { log.Info("Deleting resource as it cannot be updated, it will be recreated") reconciledMeta, err := meta.Accessor(params.Reconciled) From 0d3a897f635e78928a527771c43f2c6e16451908 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Tue, 29 Oct 2024 22:00:16 +0100 Subject: [PATCH 06/12] Check being deleted only after deleting --- .../common/reconciler/reconciler.go | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkg/controller/common/reconciler/reconciler.go b/pkg/controller/common/reconciler/reconciler.go index ea4a822078..9354926949 100644 --- a/pkg/controller/common/reconciler/reconciler.go +++ b/pkg/controller/common/reconciler/reconciler.go @@ -88,16 +88,19 @@ func ReconcileResource(params Params) error { namespace := params.Expected.GetNamespace() name := params.Expected.GetName() log := ulog.FromContext(params.Context).WithValues("kind", kind, "namespace", namespace, "name", name) + deleted := false create := func() error { - // check if not being deleted - err = params.Client.Get(params.Context, types.NamespacedName{Name: name, Namespace: namespace}, params.Reconciled) - if err != nil && !apierrors.IsNotFound(err) { - return err - } - if !params.Reconciled.GetDeletionTimestamp().IsZero() { - log.Info("Waiting for resource to be created because the old one is being deleted") - return nil + if deleted { + // check if not being deleted + err = params.Client.Get(params.Context, types.NamespacedName{Name: name, Namespace: namespace}, params.Reconciled) + if err != nil && !apierrors.IsNotFound(err) { + return err + } + if !params.Reconciled.GetDeletionTimestamp().IsZero() { + log.Info("Waiting for resource to be created because the old one is being deleted") + return nil + } } log.Info("Creating resource") @@ -157,6 +160,7 @@ func ReconcileResource(params Params) error { return fmt.Errorf("failed to delete %s %s/%s: %w", kind, namespace, name, err) } log.Info("Deleted resource successfully") + deleted = true return create() } From d38519e2f45d28c2db640ed17ddc83b0c025f663 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Tue, 29 Oct 2024 23:08:30 +0100 Subject: [PATCH 07/12] Revert explicit check on type to recreate when type changes --- pkg/controller/common/service_control.go | 5 ----- pkg/controller/common/service_control_test.go | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/pkg/controller/common/service_control.go b/pkg/controller/common/service_control.go index 859aa7da77..551552b239 100644 --- a/pkg/controller/common/service_control.go +++ b/pkg/controller/common/service_control.go @@ -88,11 +88,6 @@ func needsUpdate(expected *corev1.Service, reconciled *corev1.Service) bool { // applyServerSideValues applies any default that may have been set from the reconciled version. func applyServerSideValues(expected, reconciled *corev1.Service) { - // shortcut if the service type has changed - if expected.Spec.Type != reconciled.Spec.Type { - return - } - // Type may be defaulted by the api server if expected.Spec.Type == "" { expected.Spec.Type = reconciled.Spec.Type diff --git a/pkg/controller/common/service_control_test.go b/pkg/controller/common/service_control_test.go index cb70e37d74..6404017907 100644 --- a/pkg/controller/common/service_control_test.go +++ b/pkg/controller/common/service_control_test.go @@ -275,18 +275,6 @@ func Test_needsRecreate(t *testing.T) { }, want: true, }, - { - name: "Needs recreate to go from LoadBalancer type to ClusterIP", - args: args{ - expected: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, - }}, - reconciled: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeLoadBalancer, - }}, - }, - want: true, - }, { name: "Removing the load balancer class is OK if target type is no longer LoadBalancer", args: args{ From 4a9aac014063505d84302fdb7df2ac7b3c6ebd2e Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Tue, 29 Oct 2024 23:09:45 +0100 Subject: [PATCH 08/12] Update unit tests with default ClusterIP value --- pkg/controller/common/service_control_test.go | 12 +++------- .../elasticsearch/services/services_test.go | 22 +++++++++---------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/pkg/controller/common/service_control_test.go b/pkg/controller/common/service_control_test.go index 6404017907..a0fe01837a 100644 --- a/pkg/controller/common/service_control_test.go +++ b/pkg/controller/common/service_control_test.go @@ -317,14 +317,12 @@ func Test_applyServerSideValues(t *testing.T) { args: args{ expected: corev1.Service{Spec: corev1.ServiceSpec{}}, reconciled: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, ClusterIP: "1.2.3.4", ClusterIPs: []string{"1.2.3.4"}, SessionAffinity: corev1.ServiceAffinityClientIP, }}, }, want: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, ClusterIP: "1.2.3.4", ClusterIPs: []string{"1.2.3.4"}, SessionAffinity: corev1.ServiceAffinityClientIP, @@ -335,14 +333,12 @@ func Test_applyServerSideValues(t *testing.T) { args: args{ expected: corev1.Service{Spec: corev1.ServiceSpec{}}, reconciled: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, ClusterIP: "None", ClusterIPs: []string{"None"}, SessionAffinity: corev1.ServiceAffinityClientIP, }}, }, want: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, ClusterIP: "None", ClusterIPs: []string{"None"}, SessionAffinity: corev1.ServiceAffinityClientIP, @@ -531,14 +527,12 @@ func Test_applyServerSideValues(t *testing.T) { args: args{ expected: corev1.Service{Spec: corev1.ServiceSpec{}}, reconciled: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, ClusterIP: "1.2.3.4", SessionAffinity: corev1.ServiceAffinityClientIP, IPFamilies: []corev1.IPFamily{corev1.IPv6Protocol}, }}, }, want: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, ClusterIP: "1.2.3.4", SessionAffinity: corev1.ServiceAffinityClientIP, IPFamilies: []corev1.IPFamily{corev1.IPv6Protocol}, @@ -551,13 +545,11 @@ func Test_applyServerSideValues(t *testing.T) { IPFamilies: []corev1.IPFamily{corev1.IPv6Protocol}, }}, reconciled: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, ClusterIP: "1.2.3.4", SessionAffinity: corev1.ServiceAffinityClientIP, }}, }, want: corev1.Service{Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, ClusterIP: "1.2.3.4", SessionAffinity: corev1.ServiceAffinityClientIP, IPFamilies: []corev1.IPFamily{corev1.IPv6Protocol}, @@ -602,7 +594,9 @@ func Test_applyServerSideValues(t *testing.T) { { name: "Reconciled LoadBalancerClass is used if the expected one is empty", args: args{ - expected: corev1.Service{Spec: corev1.ServiceSpec{}}, + expected: corev1.Service{Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeLoadBalancer, + }}, reconciled: corev1.Service{Spec: corev1.ServiceSpec{ Type: corev1.ServiceTypeLoadBalancer, LoadBalancerClass: ptr.To("service.k8s.aws/nlb"), diff --git a/pkg/controller/elasticsearch/services/services_test.go b/pkg/controller/elasticsearch/services/services_test.go index 683cebcbcc..a1501da4d9 100644 --- a/pkg/controller/elasticsearch/services/services_test.go +++ b/pkg/controller/elasticsearch/services/services_test.go @@ -70,7 +70,7 @@ func TestNewExternalService(t *testing.T) { }{ { name: "default clusterIP service", - wantSvc: mkHTTPService, + wantSvc: mkHTTPSService, }, { name: "no TLS", @@ -96,11 +96,7 @@ func TestNewExternalService(t *testing.T) { }, }, }, - wantSvc: func() corev1.Service { - svc := mkHTTPService() - svc.Spec.Ports[0].Name = "https" - return svc - }, + wantSvc: mkHTTPSService, }, { name: "user-provided certificate", @@ -111,11 +107,7 @@ func TestNewExternalService(t *testing.T) { }, }, }, - wantSvc: func() corev1.Service { - svc := mkHTTPService() - svc.Spec.Ports[0].Name = "https" - return svc - }, + wantSvc: mkHTTPSService, }, } @@ -178,7 +170,7 @@ func mkHTTPService() corev1.Service { Type: corev1.ServiceTypeClusterIP, Ports: []corev1.ServicePort{ { - Name: "https", + Name: "http", Protocol: corev1.ProtocolTCP, Port: network.HTTPPort, }, @@ -191,6 +183,12 @@ func mkHTTPService() corev1.Service { } } +func mkHTTPSService() corev1.Service { + svc := mkHTTPService() + svc.Spec.Ports[0].Name = "https" + return svc +} + func mkTransportService() corev1.Service { return corev1.Service{ ObjectMeta: metav1.ObjectMeta{ From ecaf23effb6053c7a4053f2950ada8ac4696f9d5 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Tue, 29 Oct 2024 23:10:37 +0100 Subject: [PATCH 09/12] nit: reuse svc and move --- pkg/controller/elasticsearch/services/services.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/controller/elasticsearch/services/services.go b/pkg/controller/elasticsearch/services/services.go index 81df29e527..4e9ababd50 100644 --- a/pkg/controller/elasticsearch/services/services.go +++ b/pkg/controller/elasticsearch/services/services.go @@ -103,6 +103,10 @@ func NewExternalService(es esv1.Elasticsearch) *corev1.Service { svc.ObjectMeta.Namespace = es.Namespace svc.ObjectMeta.Name = ExternalServiceName(es.Name) + // defaults to ClusterIP if not set + if svc.Spec.Type == "" { + svc.Spec.Type = corev1.ServiceTypeClusterIP + } labels := label.NewLabels(nsn) ports := []corev1.ServicePort{ { @@ -112,11 +116,6 @@ func NewExternalService(es esv1.Elasticsearch) *corev1.Service { }, } - // defaults to ClusterIP if not set - if es.Spec.HTTP.Service.Spec.Type == "" { - svc.Spec.Type = corev1.ServiceTypeClusterIP - } - return defaults.SetServiceDefaults(&svc, labels, labels, ports) } From 0218fd6db86e4e79b1c664661719929f0f5bd967 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Wed, 30 Oct 2024 12:21:19 +0100 Subject: [PATCH 10/12] Revert being deleted detection in favor of handling AlreadyExists error at the caller level --- .../common/reconciler/reconciler.go | 20 ------------------- pkg/controller/elasticsearch/driver/driver.go | 4 ++++ 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/pkg/controller/common/reconciler/reconciler.go b/pkg/controller/common/reconciler/reconciler.go index 9354926949..9435e2011c 100644 --- a/pkg/controller/common/reconciler/reconciler.go +++ b/pkg/controller/common/reconciler/reconciler.go @@ -88,21 +88,8 @@ func ReconcileResource(params Params) error { namespace := params.Expected.GetNamespace() name := params.Expected.GetName() log := ulog.FromContext(params.Context).WithValues("kind", kind, "namespace", namespace, "name", name) - deleted := false create := func() error { - if deleted { - // check if not being deleted - err = params.Client.Get(params.Context, types.NamespacedName{Name: name, Namespace: namespace}, params.Reconciled) - if err != nil && !apierrors.IsNotFound(err) { - return err - } - if !params.Reconciled.GetDeletionTimestamp().IsZero() { - log.Info("Waiting for resource to be created because the old one is being deleted") - return nil - } - } - log.Info("Creating resource") if params.PreCreate != nil { if err := params.PreCreate(); err != nil { @@ -134,12 +121,6 @@ func ReconcileResource(params Params) error { return fmt.Errorf("failed to get %s %s/%s: %w", kind, namespace, name, err) } - // shortcut if being deleted - if !params.Reconciled.GetDeletionTimestamp().IsZero() { - log.Info("Skip reconciliation because the resource is being deleted") - return nil - } - if params.NeedsRecreate != nil && params.NeedsRecreate() { log.Info("Deleting resource as it cannot be updated, it will be recreated") reconciledMeta, err := meta.Accessor(params.Reconciled) @@ -160,7 +141,6 @@ func ReconcileResource(params Params) error { return fmt.Errorf("failed to delete %s %s/%s: %w", kind, namespace, name, err) } log.Info("Deleted resource successfully") - deleted = true return create() } diff --git a/pkg/controller/elasticsearch/driver/driver.go b/pkg/controller/elasticsearch/driver/driver.go index cae7fae24c..df3defd16b 100644 --- a/pkg/controller/elasticsearch/driver/driver.go +++ b/pkg/controller/elasticsearch/driver/driver.go @@ -13,6 +13,7 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/tools/record" "k8s.io/utils/ptr" controller "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -140,6 +141,9 @@ func (d *defaultDriver) Reconcile(ctx context.Context) *reconciler.Results { externalService, err := common.ReconcileService(ctx, d.Client, services.NewExternalService(d.ES), &d.ES) if err != nil { + if apierrors.IsAlreadyExists(err) { + return results.WithReconciliationState(defaultRequeue.WithReason("Could not reconcile external service")) + } return results.WithError(err) } From 79a182dae9d40efa0c9e341fdf6060ca7d9ccea1 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Wed, 30 Oct 2024 12:21:39 +0100 Subject: [PATCH 11/12] skip applyServerSideValues if the service type changes from something different to the default ClusterIP value --- pkg/controller/common/service_control.go | 5 +++ pkg/controller/common/service_control_test.go | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/pkg/controller/common/service_control.go b/pkg/controller/common/service_control.go index 551552b239..3c49136d8b 100644 --- a/pkg/controller/common/service_control.go +++ b/pkg/controller/common/service_control.go @@ -88,6 +88,11 @@ func needsUpdate(expected *corev1.Service, reconciled *corev1.Service) bool { // applyServerSideValues applies any default that may have been set from the reconciled version. func applyServerSideValues(expected, reconciled *corev1.Service) { + // skip if the service type changes from something different to the default ClusterIP value + if reconciled.Spec.Type != corev1.ServiceTypeClusterIP && expected.Spec.Type != reconciled.Spec.Type { + return + } + // Type may be defaulted by the api server if expected.Spec.Type == "" { expected.Spec.Type = reconciled.Spec.Type diff --git a/pkg/controller/common/service_control_test.go b/pkg/controller/common/service_control_test.go index a0fe01837a..0807e0fe90 100644 --- a/pkg/controller/common/service_control_test.go +++ b/pkg/controller/common/service_control_test.go @@ -637,6 +637,37 @@ func Test_applyServerSideValues(t *testing.T) { Type: corev1.ServiceTypeClusterIP, }}, }, + { + name: "Do not apply server side values if Type changed to the default ClusterIP from another type", + args: args{ + expected: corev1.Service{Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeClusterIP, + }}, + reconciled: corev1.Service{Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeNodePort, + ExternalTrafficPolicy: corev1.ServiceExternalTrafficPolicyCluster, + }}, + }, + want: corev1.Service{Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeClusterIP, + }}, + }, + { + name: "Apply server side values if Type changed from the default ClusterIP to another type", + args: args{ + expected: corev1.Service{Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeNodePort, + }}, + reconciled: corev1.Service{Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeNodePort, + ClusterIP: "1.2.3.4", + }}, + }, + want: corev1.Service{Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeNodePort, + ClusterIP: "1.2.3.4", + }}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From f320dcccc392499fd9893e49cc02b3c2fa8c4923 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Wed, 30 Oct 2024 14:51:53 +0100 Subject: [PATCH 12/12] Better message after requeuing for external service reconciliation --- pkg/controller/elasticsearch/driver/driver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/elasticsearch/driver/driver.go b/pkg/controller/elasticsearch/driver/driver.go index df3defd16b..434636b048 100644 --- a/pkg/controller/elasticsearch/driver/driver.go +++ b/pkg/controller/elasticsearch/driver/driver.go @@ -142,7 +142,7 @@ func (d *defaultDriver) Reconcile(ctx context.Context) *reconciler.Results { externalService, err := common.ReconcileService(ctx, d.Client, services.NewExternalService(d.ES), &d.ES) if err != nil { if apierrors.IsAlreadyExists(err) { - return results.WithReconciliationState(defaultRequeue.WithReason("Could not reconcile external service")) + return results.WithReconciliationState(defaultRequeue.WithReason(fmt.Sprintf("Pending %s service recreation", services.ExternalServiceName(d.ES.Name)))) } return results.WithError(err) }