Skip to content

Commit

Permalink
🐛 Bump sdk-go to v6.2.0 and update types (#198)
Browse files Browse the repository at this point in the history
**What is the purpose of this pull request/Why do we need it?**
[sdk-go](https://github.com/ionos-cloud/sdk-go/) made upstream changes
in the new release
[v6.2.0](https://github.com/ionos-cloud/sdk-go/releases/tag/v6.2.0).
They changed some LAN related type names, so we need to adapt to that.

**Issue #, if available:**

**Description of changes:**
Renamed types to new names from upstream

**Special notes for your reviewer:**

**Checklist:**
- [x] Includes
[emojis](https://github.com/kubernetes-sigs/kubebuilder-release-tools?tab=readme-ov-file#kubebuilder-project-versioning)
  • Loading branch information
jriedel-ionos authored Aug 5, 2024
1 parent deda766 commit 77e8224
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/go-logr/logr v1.4.2
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/ionos-cloud/sdk-go/v6 v6.1.11
github.com/ionos-cloud/sdk-go/v6 v6.2.0
github.com/jarcoal/httpmock v1.3.1
github.com/onsi/ginkgo/v2 v2.19.1
github.com/onsi/gomega v1.34.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/ionos-cloud/sdk-go/v6 v6.1.11 h1:J/uRN4UWO3wCyGOeDdMKv8LWRzKu6UIkLEaes38Kzh8=
github.com/ionos-cloud/sdk-go/v6 v6.1.11/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k=
github.com/ionos-cloud/sdk-go/v6 v6.2.0 h1:qX7gachC0wJSmFfVRnd+DHmz9AStvVraKcwQ/JokIB4=
github.com/ionos-cloud/sdk-go/v6 v6.2.0/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k=
github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww=
github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg=
github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
Expand Down
2 changes: 1 addition & 1 deletion internal/ionoscloud/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Client interface {
DeleteVolume(ctx context.Context, datacenterID, volumeID string) (string, error)
// CreateLAN creates a new LAN with the provided properties in the specified data center,
// returning the request path.
CreateLAN(ctx context.Context, datacenterID string, properties sdk.LanPropertiesPost) (string, error)
CreateLAN(ctx context.Context, datacenterID string, properties sdk.LanProperties) (string, error)
// PatchLAN patches the LAN that matches lanID in the specified data center with the provided properties,
// returning the request location.
PatchLAN(ctx context.Context, datacenterID, lanID string, properties sdk.LanProperties) (string, error)
Expand Down
4 changes: 2 additions & 2 deletions internal/ionoscloud/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ func (c *IonosCloudClient) DeleteVolume(ctx context.Context, datacenterID, volum

// CreateLAN creates a new LAN with the provided properties in the specified data center,
// returning the request location.
func (c *IonosCloudClient) CreateLAN(ctx context.Context, datacenterID string, properties sdk.LanPropertiesPost,
func (c *IonosCloudClient) CreateLAN(ctx context.Context, datacenterID string, properties sdk.LanProperties,
) (string, error) {
if datacenterID == "" {
return "", errDatacenterIDIsEmpty
}
lanPost := sdk.LanPost{
lanPost := sdk.Lan{
Properties: &properties,
}
_, req, err := c.API.LANsApi.DatacentersLansPost(ctx, datacenterID).Lan(lanPost).Execute()
Expand Down
16 changes: 8 additions & 8 deletions internal/ionoscloud/clienttest/mock_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/service/cloud/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (s *Service) getLAN(ctx context.Context, ms *scope.Machine) (*sdk.Lan, erro
func (s *Service) createLAN(ctx context.Context, ms *scope.Machine) error {
log := s.logger.WithName("createLAN")

lanProperties := sdk.LanPropertiesPost{
lanProperties := sdk.LanProperties{
Name: ptr.To(s.lanName(ms.ClusterScope.Cluster)),
Public: ptr.To(true),
Ipv6CidrBlock: ptr.To("AUTO"), // IPv6 is enabled by default.
Expand Down
2 changes: 1 addition & 1 deletion internal/service/cloud/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ func (s *lanSuite) examplePatchRequest(status string) sdk.Request {
}

func (s *lanSuite) mockCreateLANCall() *clienttest.MockClient_CreateLAN_Call {
return s.ionosClient.EXPECT().CreateLAN(s.ctx, s.machineScope.DatacenterID(), sdk.LanPropertiesPost{
return s.ionosClient.EXPECT().CreateLAN(s.ctx, s.machineScope.DatacenterID(), sdk.LanProperties{
Name: ptr.To(s.service.lanName(s.clusterScope.Cluster)),
Public: ptr.To(true),
Ipv6CidrBlock: ptr.To("AUTO"),
Expand Down

0 comments on commit 77e8224

Please sign in to comment.