Skip to content

Commit f9114b5

Browse files
fix: snyk errors and missing mock services (#540)
The build check were failing because of 3rd party dependency coming soon from upctl deploy starter-kit. Changes in the sdk made the mock service used in the testing to fail because some classes where missing. list_test.go, part of the server tests was failing because of changes made for the floating ip address in the sdk. I manually upgraded to latest sdk release
1 parent 2855970 commit f9114b5

5 files changed

Lines changed: 41 additions & 3 deletions

File tree

.snyk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: v1.25.0
2+
ignore:
3+
"snyk:lic:golang:github.com:hashicorp:errwrap:MPL-2.0":
4+
- "*":
5+
reason: "Allowed MPL-2.0 license for errwrap (transitive via Helm SDK for upctl stacks)"
6+
expires: 2027-01-01T00:00:00.000Z
7+
"snyk:lic:golang:github.com:hashicorp:go-multierror:MPL-2.0":
8+
- "*":
9+
reason: "Allowed MPL-2.0 license for go-multierror (transitive via Helm SDK for upctl stacks)"
10+
expires: 2027-01-01T00:00:00.000Z

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.25.0
55
require (
66
github.com/UpCloudLtd/progress v1.0.3
77
github.com/UpCloudLtd/upcloud-go-api/credentials v0.1.1
8-
github.com/UpCloudLtd/upcloud-go-api/v8 v8.26.0
8+
github.com/UpCloudLtd/upcloud-go-api/v8 v8.28.0
99
github.com/adrg/xdg v0.5.3
1010
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
1111
github.com/gemalto/flume v1.0.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ github.com/UpCloudLtd/progress v1.0.3 h1:8SfntHkBPyQc5BL3946Bgi9KYnQOxa5RR2EKdad
399399
github.com/UpCloudLtd/progress v1.0.3/go.mod h1:iGxOnb9HvHW0yrLGUjHr0lxHhn7TehgWwh7a8NqK6iQ=
400400
github.com/UpCloudLtd/upcloud-go-api/credentials v0.1.1 h1:eTfQsv58ufALOk9BZ7WbS/i7pMUD11RnYYpRPsz0LdI=
401401
github.com/UpCloudLtd/upcloud-go-api/credentials v0.1.1/go.mod h1:7OtVs2UqtfvjkC1HfE+Oud0MnbMv7qUWnbEgxnTAqts=
402-
github.com/UpCloudLtd/upcloud-go-api/v8 v8.26.0 h1:CmbgIINYPiQ0EIwihpUtqz9PZQEiNQfScNwvQKIJEBQ=
403-
github.com/UpCloudLtd/upcloud-go-api/v8 v8.26.0/go.mod h1:NBh1d/ip1bhdAIhuPWbyPme7tbLzDTV7dhutUmU1vg8=
402+
github.com/UpCloudLtd/upcloud-go-api/v8 v8.28.0 h1:51v7vnzSlTtEHP7lzyudLRgEQqd53+SADCrUaSX/Zdg=
403+
github.com/UpCloudLtd/upcloud-go-api/v8 v8.28.0/go.mod h1:NBh1d/ip1bhdAIhuPWbyPme7tbLzDTV7dhutUmU1vg8=
404404
github.com/adrg/xdg v0.5.3 h1:xRnxJXne7+oWDatRhR1JLnvuccuIeCoBu2rtuLqQB78=
405405
github.com/adrg/xdg v0.5.3/go.mod h1:nlTsY+NNiCBGCK2tpm09vRqfVzrc2fLmXGpBLF0zlTQ=
406406
github.com/ansel1/merry v1.5.0/go.mod h1:wUy/yW0JX0ix9GYvUbciq+bi3jW/vlKPlbpI7qdZpOw=

internal/commands/server/list_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const expectedJSONOutput = `
3737
"family": "",
3838
"part_of_plan": "no",
3939
"ptr_record": "",
40+
"release_policy": "",
4041
"server": "",
4142
"mac": "",
4243
"floating": "yes",
@@ -49,6 +50,7 @@ const expectedJSONOutput = `
4950
"family": "",
5051
"part_of_plan": "no",
5152
"ptr_record": "",
53+
"release_policy": "",
5254
"server": "",
5355
"mac": "",
5456
"floating": "no",
@@ -61,6 +63,7 @@ const expectedJSONOutput = `
6163
"family": "",
6264
"part_of_plan": "no",
6365
"ptr_record": "",
66+
"release_policy": "",
6467
"server": "",
6568
"mac": "",
6669
"floating": "no",
@@ -73,6 +76,7 @@ const expectedJSONOutput = `
7376
"family": "",
7477
"part_of_plan": "no",
7578
"ptr_record": "",
79+
"release_policy": "",
7680
"server": "",
7781
"mac": "",
7882
"floating": "no",

internal/mock/mock.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,30 @@ type Service struct {
1616
mock.Mock
1717
}
1818

19+
// AttachLoadBalancerIPAddress implements service.LoadBalancer.
20+
func (m *Service) AttachLoadBalancerIPAddress(ctx context.Context, r *request.AttachLoadBalancerIPAddressRequest) (upcloud.LoadBalancerFloatingIPAddress, error) {
21+
return upcloud.LoadBalancerFloatingIPAddress{}, nil
22+
}
23+
24+
// GetLoadBalancerIPAddresses implements service.LoadBalancer.
25+
func (m *Service) GetLoadBalancerIPAddresses(ctx context.Context, r *request.GetLoadBalancerIPAddressesRequest) ([]upcloud.LoadBalancerFloatingIPAddress, error) {
26+
return []upcloud.LoadBalancerFloatingIPAddress{}, nil
27+
}
28+
29+
// RemoveLoadBalancerIPAddress implements service.LoadBalancer.
30+
func (m *Service) RemoveLoadBalancerIPAddress(ctx context.Context, r *request.RemoveLoadBalancerIPAddressRequest) error {
31+
return nil
32+
}
33+
34+
// GetAllManagedDatabases implements service.AllServices (or the interface that declares it).
35+
func (m *Service) GetAllManagedDatabases(_ context.Context) ([]upcloud.ManagedDatabase, error) {
36+
args := m.Called()
37+
if args[0] == nil {
38+
return nil, args.Error(1)
39+
}
40+
return args[0].([]upcloud.ManagedDatabase), args.Error(1)
41+
}
42+
1943
func (m *Service) CreateToken(_ context.Context, r *request.CreateTokenRequest) (*upcloud.Token, error) {
2044
args := m.Called(r)
2145
if args[0] == nil {

0 commit comments

Comments
 (0)