Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:

### Configurable backup job retry limit [#1579](https://github.com/devfile/devworkspace-operator/issues/1579)

Administrators can now configure the maximum number of retries for backup jobs in the DevWorkspaceOperatorConfig via the `backoffLimit` field. The default value is 3.
Administrators can now configure the maximum number of retries for backup jobs in the DevWorkspaceOperatorConfig via the `backoffLimit` field. The default value is 1.

```yaml
apiVersion: controller.devfile.io/v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ type BackupCronJobConfig struct {
// +kubebuilder:validation:Optional
Schedule string `json:"schedule,omitempty"`
// BackoffLimit specifies the number of retries before marking a backup job as failed.
// Defaults to 3 if not specified.
// Defaults to 1 if not specified.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:default:=3
// +kubebuilder:default:=1
// +kubebuilder:validation:Optional
BackoffLimit *int32 `json:"backoffLimit,omitempty"`
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/backupcronjob/backupcronjob_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ var _ = Describe("BackupCronJobReconciler", func() {
It("creates a Job with configured backoffLimit", func() {
enabled := true
schedule := "* * * * *"
backoffLimit := int32(1)
backoffLimit := int32(2)
dwoc := &controllerv1alpha1.DevWorkspaceOperatorConfig{
ObjectMeta: metav1.ObjectMeta{Name: nameNamespace.Name, Namespace: nameNamespace.Namespace},
Config: &controllerv1alpha1.OperatorConfiguration{
Expand Down Expand Up @@ -413,7 +413,7 @@ var _ = Describe("BackupCronJobReconciler", func() {
Expect(fakeClient.List(ctx, jobList, &client.ListOptions{Namespace: dw.Namespace})).To(Succeed())
Expect(jobList.Items).To(HaveLen(1))
Expect(jobList.Items[0].Spec.BackoffLimit).ToNot(BeNil())
Expect(*jobList.Items[0].Spec.BackoffLimit).To(Equal(int32(1)))
Expect(*jobList.Items[0].Spec.BackoffLimit).To(Equal(int32(2)))
})

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions deploy/deployment/kubernetes/combined.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions deploy/deployment/openshift/combined.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ var defaultConfig = &v1alpha1.OperatorConfiguration{
BackupCronJob: &v1alpha1.BackupCronJobConfig{
Enable: pointer.Bool(false),
Schedule: "0 0 1 * *",
BackoffLimit: pointer.Int32(3),
BackoffLimit: pointer.Int32(1),
},
// Do not declare a default value for this field.
// Setting a default leads to an endless reconcile loop when UserNamespacesSupport is disabled,
Expand Down