Skip to content

Commit

Permalink
fix(deps): update module github.com/stackitcloud/stackit-sdk-go/servi…
Browse files Browse the repository at this point in the history
…ces/ske to v0.21.1 (#573)

* Remove GetServiceStatusExecute for ske service

Function was deprecated on 2024-04-16 and was now removed.

Signed-off-by: Alexander Dahmen <[email protected]>

* Adjust ske datatypes

Signed-off-by: Alexander Dahmen <[email protected]>

* chore: fix testcase setup

* fix(deps): update module github.com/stackitcloud/stackit-sdk-go/services/ske to v0.21.1

---------

Signed-off-by: Alexander Dahmen <[email protected]>
Co-authored-by: Alexander Dahmen <[email protected]>
Co-authored-by: Rüdiger Schmitz <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
  • Loading branch information
4 people authored Jan 23, 2025
1 parent ec2aa5e commit deb5103
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v0.5.0
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.5.0
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v0.4.0
github.com/stackitcloud/stackit-sdk-go/services/ske v0.21.0
github.com/stackitcloud/stackit-sdk-go/services/ske v0.21.1
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v0.9.0
github.com/zalando/go-keyring v0.2.6
golang.org/x/mod v0.22.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.5.0 h1:yf9BxAZ
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.5.0/go.mod h1:Wpqj80yGruCNYGr2yxqhRaLLj4gPSkhJqZyWRXUh/QU=
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v0.4.0 h1:K5fVTcJxjOVwJBa3kiWRsYNAq+I3jAYdU1U+f6no5lE=
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v0.4.0/go.mod h1:zyg0hpiNdZLRbelkJb2KDf9OHQKLqqcTpePQ1qHL5dE=
github.com/stackitcloud/stackit-sdk-go/services/ske v0.21.0 h1:Pew85wQJe2e9K8ZRzxeFSimI29aqUZwOT/Ty0N1K+c0=
github.com/stackitcloud/stackit-sdk-go/services/ske v0.21.0/go.mod h1:iZyh3DMi2fUZxAIseykjKfDo2wf2FIDwpF43I22b8uk=
github.com/stackitcloud/stackit-sdk-go/services/ske v0.21.1 h1:oO+wCobC4OfH+vpfJQEnCUQuKVILRj5mQojBbzWgzDA=
github.com/stackitcloud/stackit-sdk-go/services/ske v0.21.1/go.mod h1:iZyh3DMi2fUZxAIseykjKfDo2wf2FIDwpF43I22b8uk=
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v0.9.0 h1:OYWT7B63isBPyVuPxd3yobvky7/nhcXQxaBgPki5nR4=
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v0.9.0/go.mod h1:vrl+OVJkjjupkvfkqY2T3HAB6x2x0S6zDhdFB5BWEnU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
5 changes: 3 additions & 2 deletions internal/cmd/ske/cluster/create/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package create
import (
"context"
"testing"
"time"

"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
Expand Down Expand Up @@ -60,8 +61,8 @@ var testPayload = &ske.CreateOrUpdateClusterPayload{
MachineImageVersion: utils.Ptr(true),
},
TimeWindow: &ske.TimeWindow{
End: utils.Ptr("0000-01-01T05:00:00+02:00"),
Start: utils.Ptr("0000-01-01T03:00:00+02:00"),
End: utils.Ptr(time.Date(0, 1, 1, 5, 0, 0, 0, time.FixedZone("test-zone", 2*60*60))),
Start: utils.Ptr(time.Date(0, 1, 1, 3, 0, 0, 0, time.FixedZone("test-zone", 2*60*60))),
},
},
}
Expand Down
5 changes: 3 additions & 2 deletions internal/cmd/ske/cluster/update/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package update
import (
"context"
"testing"
"time"

"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
Expand Down Expand Up @@ -60,8 +61,8 @@ var testPayload = ske.CreateOrUpdateClusterPayload{
MachineImageVersion: utils.Ptr(true),
},
TimeWindow: &ske.TimeWindow{
End: utils.Ptr("0000-01-01T05:00:00+02:00"),
Start: utils.Ptr("0000-01-01T03:00:00+02:00"),
End: utils.Ptr(time.Date(0, 1, 1, 5, 0, 0, 0, time.FixedZone("test-zone", 2*60*60))),
Start: utils.Ptr(time.Date(0, 1, 1, 3, 0, 0, 0, time.FixedZone("test-zone", 2*60*60))),
},
},
}
Expand Down
5 changes: 3 additions & 2 deletions internal/cmd/ske/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"strings"
"time"

"github.com/goccy/go-yaml"
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
Expand Down Expand Up @@ -238,7 +239,7 @@ func buildKubernetesVersionsTable(resp *ske.ProviderOptions) (tables.Table, erro
}
expirationDate := ""
if v.ExpirationDate != nil {
expirationDate = *v.ExpirationDate
expirationDate = v.ExpirationDate.Format(time.RFC3339)
}
table.AddRow(*v.Version, *v.State, expirationDate, string(featureGate))
}
Expand All @@ -265,7 +266,7 @@ func buildMachineImagesTable(resp *ske.ProviderOptions) tables.Table {

expirationDate := "-"
if version.ExpirationDate != nil {
expirationDate = *version.ExpirationDate
expirationDate = version.ExpirationDate.Format(time.RFC3339)
}
table.AddRow(*image.Name, *version.Version, *version.State, expirationDate, criNamesString)
}
Expand Down
1 change: 0 additions & 1 deletion internal/pkg/services/ske/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const (
)

type SKEClient interface {
GetServiceStatusExecute(ctx context.Context, projectId string) (*ske.ProjectResponse, error)
ListClustersExecute(ctx context.Context, projectId string) (*ske.ListClustersResponse, error)
ListProviderOptionsExecute(ctx context.Context) (*ske.ProviderOptions, error)
}
Expand Down
14 changes: 0 additions & 14 deletions internal/pkg/services/ske/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/uuid"
"github.com/stackitcloud/stackit-sdk-go/core/oapierror"
"github.com/stackitcloud/stackit-sdk-go/services/ske"
)

Expand Down Expand Up @@ -65,25 +64,12 @@ users:
)

type skeClientMocked struct {
serviceDisabled bool
getServiceStatusFails bool
getServiceStatusResp *ske.ProjectResponse
listClustersFails bool
listClustersResp *ske.ListClustersResponse
listProviderOptionsFails bool
listProviderOptionsResp *ske.ProviderOptions
}

func (m *skeClientMocked) GetServiceStatusExecute(_ context.Context, _ string) (*ske.ProjectResponse, error) {
if m.getServiceStatusFails {
return nil, fmt.Errorf("could not get service status")
}
if m.serviceDisabled {
return nil, &oapierror.GenericOpenAPIError{StatusCode: 404}
}
return m.getServiceStatusResp, nil
}

func (m *skeClientMocked) ListClustersExecute(_ context.Context, _ string) (*ske.ListClustersResponse, error) {
if m.listClustersFails {
return nil, fmt.Errorf("could not list clusters")
Expand Down

0 comments on commit deb5103

Please sign in to comment.