From f45eebdda3ab9c8606cb40949388f8729436a181 Mon Sep 17 00:00:00 2001 From: Phil Brookes Date: Wed, 20 Sep 2023 09:36:47 +0100 Subject: [PATCH 1/2] fix probe status update when missing headers secret --- .../dnshealthcheckprobe_controller.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkg/controllers/dnshealthcheckprobe/dnshealthcheckprobe_controller.go b/pkg/controllers/dnshealthcheckprobe/dnshealthcheckprobe_controller.go index f149d8e19..a14942e2d 100644 --- a/pkg/controllers/dnshealthcheckprobe/dnshealthcheckprobe_controller.go +++ b/pkg/controllers/dnshealthcheckprobe/dnshealthcheckprobe_controller.go @@ -92,8 +92,18 @@ func (r *DNSHealthCheckProbeReconciler) Reconcile(ctx context.Context, req ctrl. additionalHeaders, err := getAdditionalHeaders(ctx, r.Client, probeObj) if err != nil { - //update probe status, ignore update errors - _ = r.Client.Status().Update(ctx, probeObj) + f := false + logger.V(1).Info( + "error getting additional headers for probe", + "secret name", probeObj.Spec.AdditionalHeadersRef.Name, + "error", err) + //update probe status + probeObj.Status.Healthy = &f + probeObj.Status.LastCheckedAt = metav1.Now() + updateErr := r.Client.Status().Update(ctx, probeObj) + if updateErr != nil { + logger.V(1).Info("error updating probe status", "error", updateErr) + } return ctrl.Result{}, err } @@ -160,7 +170,7 @@ func getAdditionalHeaders(ctx context.Context, clt client.Client, probeObj *v1al } else if err != nil { probeError := fmt.Errorf("error retrieving additional headers secret %v/%v: %w", secretKey.Namespace, secretKey.Name, err) probeObj.Status.ConsecutiveFailures = 0 - probeObj.Status.Reason = "additional headers secret not found" + probeObj.Status.Reason = fmt.Sprintf("additional headers secret '%v' not found", secretKey.Name) return additionalHeaders, probeError } for k, v := range additionalHeadersSecret.Data { From e80638e34805262e49de9c75f974f313b99b28a5 Mon Sep 17 00:00:00 2001 From: Phil Brookes Date: Wed, 20 Sep 2023 09:39:06 +0100 Subject: [PATCH 2/2] ignore kubeconfig files --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9794543e5..f7f0ed39f 100644 --- a/.gitignore +++ b/.gitignore @@ -87,7 +87,10 @@ config/deploy/**/_* /ratelimitpolicy.yaml /echo_httproute.yaml +/control-plane.yaml +/workload*.yaml + cmd/controller/__debug_bin # Submariner broker config -/broker-info.subm* \ No newline at end of file +/broker-info.subm*