From e20cebf7069845008d2a2a787bbea016a54845d2 Mon Sep 17 00:00:00 2001 From: Robin Scherrer <43877944+rxbn@users.noreply.github.com> Date: Tue, 8 Mar 2022 10:30:08 +0100 Subject: [PATCH] CO-45 Requeue DNSRecord if zone not found (#62) --- controllers/account_controller.go | 2 +- controllers/dnsrecord_controller.go | 4 ++-- controllers/zone_controller.go | 2 +- docs/content/installation.md | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/controllers/account_controller.go b/controllers/account_controller.go index 20798c8f..4501b192 100644 --- a/controllers/account_controller.go +++ b/controllers/account_controller.go @@ -127,7 +127,7 @@ func (r *AccountReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct log.Error(err, "Failed to update Account status") return ctrl.Result{}, err } - return ctrl.Result{RequeueAfter: 30 * time.Second}, err + return ctrl.Result{RequeueAfter: time.Second * 30}, err } var managedZones []cloudflare.Zone diff --git a/controllers/dnsrecord_controller.go b/controllers/dnsrecord_controller.go index 6107e6e9..02d89733 100644 --- a/controllers/dnsrecord_controller.go +++ b/controllers/dnsrecord_controller.go @@ -68,7 +68,7 @@ func (r *DNSRecordReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( log.Error(err, "Failed to update DNSRecord status") return ctrl.Result{}, err } - return ctrl.Result{RequeueAfter: 5 * time.Second}, err + return ctrl.Result{RequeueAfter: time.Second * 5}, err } zones := &cfv1beta1.ZoneList{} @@ -92,7 +92,7 @@ func (r *DNSRecordReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( log.Error(err, "Failed to update DNSRecord status") return ctrl.Result{}, err } - return ctrl.Result{}, err + return ctrl.Result{RequeueAfter: time.Second * 5}, err } if dnsRecordZone.Status.Phase != "Active" { diff --git a/controllers/zone_controller.go b/controllers/zone_controller.go index c277324f..fc934150 100644 --- a/controllers/zone_controller.go +++ b/controllers/zone_controller.go @@ -91,7 +91,7 @@ func (r *ZoneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. log.Error(err, "Failed to update Zone status") return ctrl.Result{}, err } - return ctrl.Result{RequeueAfter: 5 * time.Second}, err + return ctrl.Result{RequeueAfter: time.Second * 5}, err } _, err = r.Cf.ZoneDetails(ctx, instance.Spec.ID) diff --git a/docs/content/installation.md b/docs/content/installation.md index ce33cc31..9d71583e 100644 --- a/docs/content/installation.md +++ b/docs/content/installation.md @@ -32,7 +32,7 @@ cloudflare-operator requires a number of CRD resources, which must be installed Installing CRDs with kubectl: ```bash -kubectl apply -f https://github.com/containeroo/cloudflare-operator/releases/download/v0.1.0/crds.yaml +kubectl apply -f https://github.com/containeroo/cloudflare-operator/releases/download/v0.1.1/crds.yaml ``` 4. Install cloudflare-operator @@ -44,7 +44,7 @@ helm install \ cloudflare-operator containeroo/cloudflare-operator \ --namespace cloudflare-operator \ --create-namespace \ - --version v0.1.0 + --version v0.1.1 ``` A full list of available Helm values is on [cloudflare-operator’s ArtifactHub page](https://artifacthub.io/packages/helm/containeroo/cloudflare-operator). @@ -58,7 +58,7 @@ helm template \ cloudflare-operator containeroo/cloudflare-operator \ --namespace cloudflare-operator \ --create-namespace \ - --version v0.1.0 \ + --version v0.1.1 \ --set your.value=here ``` @@ -93,7 +93,7 @@ Finally, delete the cloudflare-operator CustomResourceDefinitions using the link This command will also remove installed cloudflare-operator objects. All cloudflare-operator resources will be removed by Kubernetes' garbage collector. ```bash -kubectl delete -f https://github.com/containeroo/cloudflare-operator/releases/download/v0.1.0/crds.yaml +kubectl delete -f https://github.com/containeroo/cloudflare-operator/releases/download/v0.1.1/crds.yaml ``` ## Namespace Stuck in Terminating State