Skip to content

Commit 2d6966e

Browse files
authored
Update backup job's default backoff limit to 1 (#1605)
Signed-off-by: dkwon17 <dakwon@redhat.com>
1 parent 6ddba09 commit 2d6966e

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
3232
### Configurable backup job retry limit [#1579](https://github.com/devfile/devworkspace-operator/issues/1579)
3333
34-
Administrators can now configure the maximum number of retries for backup jobs in the DevWorkspaceOperatorConfig via the `backoffLimit` field. The default value is 3.
34+
Administrators can now configure the maximum number of retries for backup jobs in the DevWorkspaceOperatorConfig via the `backoffLimit` field. The default value is 1.
3535

3636
```yaml
3737
apiVersion: controller.devfile.io/v1alpha1

apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ type BackupCronJobConfig struct {
112112
// +kubebuilder:validation:Optional
113113
Schedule string `json:"schedule,omitempty"`
114114
// BackoffLimit specifies the number of retries before marking a backup job as failed.
115-
// Defaults to 3 if not specified.
115+
// Defaults to 1 if not specified.
116116
// +kubebuilder:validation:Minimum=0
117-
// +kubebuilder:default:=3
117+
// +kubebuilder:default:=1
118118
// +kubebuilder:validation:Optional
119119
BackoffLimit *int32 `json:"backoffLimit,omitempty"`
120120
}

controllers/backupcronjob/backupcronjob_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ var _ = Describe("BackupCronJobReconciler", func() {
382382
It("creates a Job with configured backoffLimit", func() {
383383
enabled := true
384384
schedule := "* * * * *"
385-
backoffLimit := int32(1)
385+
backoffLimit := int32(2)
386386
dwoc := &controllerv1alpha1.DevWorkspaceOperatorConfig{
387387
ObjectMeta: metav1.ObjectMeta{Name: nameNamespace.Name, Namespace: nameNamespace.Namespace},
388388
Config: &controllerv1alpha1.OperatorConfiguration{
@@ -413,7 +413,7 @@ var _ = Describe("BackupCronJobReconciler", func() {
413413
Expect(fakeClient.List(ctx, jobList, &client.ListOptions{Namespace: dw.Namespace})).To(Succeed())
414414
Expect(jobList.Items).To(HaveLen(1))
415415
Expect(jobList.Items[0].Spec.BackoffLimit).ToNot(BeNil())
416-
Expect(*jobList.Items[0].Spec.BackoffLimit).To(Equal(int32(1)))
416+
Expect(*jobList.Items[0].Spec.BackoffLimit).To(Equal(int32(2)))
417417
})
418418

419419
It("does not create a Job when the DevWorkspace was stopped beyond time range", func() {

deploy/bundle/manifests/controller.devfile.io_devworkspaceoperatorconfigs.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/deployment/kubernetes/combined.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/deployment/kubernetes/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/deployment/openshift/combined.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/deployment/openshift/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/templates/crd/bases/controller.devfile.io_devworkspaceoperatorconfigs.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ var defaultConfig = &v1alpha1.OperatorConfiguration{
9797
BackupCronJob: &v1alpha1.BackupCronJobConfig{
9898
Enable: pointer.Bool(false),
9999
Schedule: "0 0 1 * *",
100-
BackoffLimit: pointer.Int32(3),
100+
BackoffLimit: pointer.Int32(1),
101101
},
102102
// Do not declare a default value for this field.
103103
// Setting a default leads to an endless reconcile loop when UserNamespacesSupport is disabled,

0 commit comments

Comments
 (0)