Skip to content

Commit c872cfb

Browse files
committed
Adjust ske datatypes
Signed-off-by: Alexander Dahmen <[email protected]>
1 parent 3682103 commit c872cfb

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

internal/cmd/ske/cluster/create/create_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package create
33
import (
44
"context"
55
"testing"
6+
"time"
67

78
"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
89
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
@@ -60,8 +61,8 @@ var testPayload = &ske.CreateOrUpdateClusterPayload{
6061
MachineImageVersion: utils.Ptr(true),
6162
},
6263
TimeWindow: &ske.TimeWindow{
63-
End: utils.Ptr("0000-01-01T05:00:00+02:00"),
64-
Start: utils.Ptr("0000-01-01T03:00:00+02:00"),
64+
End: utils.Ptr(time.Date(0000, 01, 01, 5, 0, 0, 0, time.UTC)),
65+
Start: utils.Ptr(time.Date(0000, 01, 01, 3, 0, 0, 0, time.UTC)),
6566
},
6667
},
6768
}

internal/cmd/ske/cluster/update/update_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package update
33
import (
44
"context"
55
"testing"
6+
"time"
67

78
"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
89
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
@@ -60,8 +61,8 @@ var testPayload = ske.CreateOrUpdateClusterPayload{
6061
MachineImageVersion: utils.Ptr(true),
6162
},
6263
TimeWindow: &ske.TimeWindow{
63-
End: utils.Ptr("0000-01-01T05:00:00+02:00"),
64-
Start: utils.Ptr("0000-01-01T03:00:00+02:00"),
64+
End: utils.Ptr(time.Date(0000, 01, 01, 5, 0, 0, 0, time.UTC)),
65+
Start: utils.Ptr(time.Date(0000, 01, 01, 3, 0, 0, 0, time.UTC)),
6566
},
6667
},
6768
}

internal/cmd/ske/options/options.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"strings"
8+
"time"
89

910
"github.com/goccy/go-yaml"
1011
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
@@ -238,7 +239,7 @@ func buildKubernetesVersionsTable(resp *ske.ProviderOptions) (tables.Table, erro
238239
}
239240
expirationDate := ""
240241
if v.ExpirationDate != nil {
241-
expirationDate = *v.ExpirationDate
242+
expirationDate = v.ExpirationDate.Format(time.RFC3339)
242243
}
243244
table.AddRow(*v.Version, *v.State, expirationDate, string(featureGate))
244245
}
@@ -265,7 +266,7 @@ func buildMachineImagesTable(resp *ske.ProviderOptions) tables.Table {
265266

266267
expirationDate := "-"
267268
if version.ExpirationDate != nil {
268-
expirationDate = *version.ExpirationDate
269+
expirationDate = version.ExpirationDate.Format(time.RFC3339)
269270
}
270271
table.AddRow(*image.Name, *version.Version, *version.State, expirationDate, criNamesString)
271272
}

0 commit comments

Comments
 (0)