Skip to content

Commit 44d3abb

Browse files
committed
update requeue parameter
`ctrl.Result{Requeue: true}` is influenced by backing off. We want to avoid it. Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
1 parent 8d370a6 commit 44d3abb

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ mock: mockgen
9090
test: manifests generate fmt vet mock ## Run tests.
9191
# adding -p 1 -v to stream logs. see https://github.com/golang/go/issues/46959
9292
ENVTEST_KUBERNETES_VERSION=$(ENVTEST_KUBERNETES_VERSION) ENVTEST_BIN_DIR=$(LOCALBIN) \
93-
SKIP_CEPH_CMD_TEST=1 \
93+
SKIP_CEPH_CMD_TEST=1 REQUEUE_RECONCILIATION_AFTER=10s \
9494
go test ./... -coverprofile cover.out -p 1 -v
9595

9696
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint

internal/controller/util.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ func IsJobConditionTrue(conditions []batchv1.JobCondition, conditionType batchv1
152152
func requeueReconciliation() ctrl.Result {
153153
requeueAfter := os.Getenv("REQUEUE_RECONCILIATION_AFTER")
154154
if requeueAfter != "" {
155-
duration, err := time.ParseDuration(requeueAfter)
156-
if err != nil {
157-
panic(fmt.Sprintf("set REQUEUE_RECONCILIATION_AFTER properly: %v", err))
158-
}
159-
return ctrl.Result{RequeueAfter: duration}
155+
panic("You should set REQUEUE_RECONCILIATION_AFTER env var.")
156+
}
157+
duration, err := time.ParseDuration(requeueAfter)
158+
if err != nil {
159+
panic(fmt.Sprintf("Set REQUEUE_RECONCILIATION_AFTER properly: %v", err))
160160
}
161-
return ctrl.Result{Requeue: true}
161+
return ctrl.Result{RequeueAfter: duration}
162162
}

test/e2e/testdata/values-mantle-secondary-template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ controller:
1313
envSecret: export-data
1414
gcInterval: 1s
1515
env:
16-
- name: REQUEUE_RECONCILIATION_IMMEDIATELY
17-
value: "1"
16+
- name: REQUEUE_RECONCILIATION_AFTER
17+
value: "10s"
1818
mtls:
1919
clientCACertConfigMap: mantle-primary-ca-crt
2020
serverTLSSecret: cert-mantle-replication

0 commit comments

Comments
 (0)