Skip to content

Commit 05160ac

Browse files
committed
rebase
1 parent 71d2bdd commit 05160ac

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

internal/cmd/storagebox/enable_snapshot_plan.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ var EnableSnapshotPlanCmd = base.Cmd{
7070
if err != nil {
7171
return err
7272
}
73-
if weekday == 0 {
74-
// The API expects 7 for Sunday
75-
weekday = 7
76-
}
77-
opts.DayOfWeek = hcloud.Ptr(int(weekday))
73+
opts.DayOfWeek = &weekday
7874
}
7975
if cmd.Flags().Changed("day-of-month") {
8076
opts.DayOfMonth = &dayOfMonth

internal/cmd/storagebox/enable_snapshot_plan_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package storagebox_test
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/stretchr/testify/assert"
78
"github.com/stretchr/testify/require"
@@ -29,7 +30,7 @@ func TestEnableSnapshotPlan(t *testing.T) {
2930
MaxSnapshots: 10,
3031
Minute: hcloud.Ptr(0),
3132
Hour: hcloud.Ptr(2),
32-
DayOfWeek: hcloud.Ptr(2),
33+
DayOfWeek: hcloud.Ptr(time.Tuesday),
3334
DayOfMonth: nil,
3435
}).
3536
Return(&hcloud.Action{ID: 456}, nil, nil)

0 commit comments

Comments
 (0)