Skip to content

Commit 9a2670d

Browse files
authored
change recovery date format (#266)
1 parent 6a802b8 commit 9a2670d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

internal/cmd/postgresflex/instance/clone/clone.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7-
"time"
87

98
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
109
cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors"
@@ -28,7 +27,7 @@ const (
2827
storageClassFlag = "storage-class"
2928
storageSizeFlag = "storage-size"
3029
recoveryTimestampFlag = "recovery-timestamp"
31-
recoveryDateFormat = time.RFC3339
30+
recoveryDateFormat = "2006-01-02T15:04:05-07:00"
3231
)
3332

3433
type inputModel struct {

internal/cmd/postgresflex/instance/clone/clone_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func fixtureRequiredInputModel(mods ...func(model *inputModel)) *inputModel {
9393
if err != nil {
9494
return &inputModel{}
9595
}
96-
recoveryTimestampString := testRecoveryTimestamp.Format(time.RFC3339)
96+
recoveryTimestampString := testRecoveryTimestamp.Format(recoveryDateFormat)
9797

9898
model := &inputModel{
9999
GlobalFlagModel: &globalflags.GlobalFlagModel{
@@ -114,7 +114,7 @@ func fixtureStandardInputModel(mods ...func(model *inputModel)) *inputModel {
114114
if err != nil {
115115
return &inputModel{}
116116
}
117-
recoveryTimestampString := testRecoveryTimestamp.Format(time.RFC3339)
117+
recoveryTimestampString := testRecoveryTimestamp.Format(recoveryDateFormat)
118118

119119
model := &inputModel{
120120
GlobalFlagModel: &globalflags.GlobalFlagModel{
@@ -146,7 +146,7 @@ func fixturePayload(mods ...func(payload *postgresflex.CloneInstancePayload)) po
146146
if err != nil {
147147
return postgresflex.CloneInstancePayload{}
148148
}
149-
recoveryTimestampString := testRecoveryTimestamp.Format(time.RFC3339)
149+
recoveryTimestampString := testRecoveryTimestamp.Format(recoveryDateFormat)
150150

151151
payload := postgresflex.CloneInstancePayload{
152152
Timestamp: utils.Ptr(recoveryTimestampString),
@@ -354,7 +354,7 @@ func TestBuildRequest(t *testing.T) {
354354
if err != nil {
355355
return
356356
}
357-
recoveryTimestampString := testRecoveryTimestamp.Format(time.RFC3339)
357+
recoveryTimestampString := testRecoveryTimestamp.Format(recoveryDateFormat)
358358

359359
tests := []struct {
360360
description string

0 commit comments

Comments
 (0)