Skip to content

Commit 173f10f

Browse files
committed
fix(object-storage): adjust for change from *time -> NullableTime
1 parent b90238a commit 173f10f

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎internal/cmd/object-storage/credentials/create/create.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *objectstora
132132
req := apiClient.DefaultAPI.CreateAccessKey(ctx, model.ProjectId, model.Region)
133133
req = req.CredentialsGroup(model.CredentialsGroupId)
134134
req = req.CreateAccessKeyPayload(objectstorage.CreateAccessKeyPayload{
135-
Expires: model.ExpireDate,
135+
Expires: *objectstorage.NewNullableTime(model.ExpireDate),
136136
})
137137
return req
138138
}

‎internal/cmd/object-storage/credentials/create/create_test.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func fixturePayload(mods ...func(payload *objectstorage.CreateAccessKeyPayload))
6868
return objectstorage.CreateAccessKeyPayload{}
6969
}
7070
payload := objectstorage.CreateAccessKeyPayload{
71-
Expires: utils.Ptr(testExpirationDate),
71+
Expires: *objectstorage.NewNullableTime(utils.Ptr(testExpirationDate)),
7272
}
7373
for _, mod := range mods {
7474
mod(&payload)
@@ -207,6 +207,7 @@ func TestBuildRequest(t *testing.T) {
207207
diff := cmp.Diff(request, tt.expectedRequest,
208208
cmp.AllowUnexported(tt.expectedRequest, objectstorage.DefaultAPIService{}),
209209
cmpopts.EquateComparable(testCtx),
210+
cmp.AllowUnexported(objectstorage.NullableTime{}),
210211
)
211212
if diff != "" {
212213
t.Fatalf("Data does not match: %s", diff)

‎internal/cmd/object-storage/credentials/list/list.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ func outputResult(p *print.Printer, outputFormat, credentialsGroupLabel string,
147147
c := credentials[i]
148148

149149
expiresAt := "Never"
150-
if c.Expires != "" {
151-
expiresAt = c.Expires
150+
if c.Expires.Get() != nil && *c.Expires.Get() != "" {
151+
expiresAt = *c.Expires.Get()
152152
}
153153
table.AddRow(c.KeyId, c.DisplayName, expiresAt)
154154
}

0 commit comments

Comments
 (0)