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
3 changes: 1 addition & 2 deletions internal/cmd/postgresflex/instance/clone/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"time"

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

type inputModel struct {
Expand Down
8 changes: 4 additions & 4 deletions internal/cmd/postgresflex/instance/clone/clone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func fixtureRequiredInputModel(mods ...func(model *inputModel)) *inputModel {
if err != nil {
return &inputModel{}
}
recoveryTimestampString := testRecoveryTimestamp.Format(time.RFC3339)
recoveryTimestampString := testRecoveryTimestamp.Format(recoveryDateFormat)

model := &inputModel{
GlobalFlagModel: &globalflags.GlobalFlagModel{
Expand All @@ -114,7 +114,7 @@ func fixtureStandardInputModel(mods ...func(model *inputModel)) *inputModel {
if err != nil {
return &inputModel{}
}
recoveryTimestampString := testRecoveryTimestamp.Format(time.RFC3339)
recoveryTimestampString := testRecoveryTimestamp.Format(recoveryDateFormat)

model := &inputModel{
GlobalFlagModel: &globalflags.GlobalFlagModel{
Expand Down Expand Up @@ -146,7 +146,7 @@ func fixturePayload(mods ...func(payload *postgresflex.CloneInstancePayload)) po
if err != nil {
return postgresflex.CloneInstancePayload{}
}
recoveryTimestampString := testRecoveryTimestamp.Format(time.RFC3339)
recoveryTimestampString := testRecoveryTimestamp.Format(recoveryDateFormat)

payload := postgresflex.CloneInstancePayload{
Timestamp: utils.Ptr(recoveryTimestampString),
Expand Down Expand Up @@ -354,7 +354,7 @@ func TestBuildRequest(t *testing.T) {
if err != nil {
return
}
recoveryTimestampString := testRecoveryTimestamp.Format(time.RFC3339)
recoveryTimestampString := testRecoveryTimestamp.Format(recoveryDateFormat)

tests := []struct {
description string
Expand Down