Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit dbd1770

Browse files
authored
Merge pull request #664 from cprivitere/metal-go-bump
🌱 bump metal-go to v0.25.0
2 parents dc74571 + 50d8d31 commit dbd1770

File tree

10 files changed

+32
-25
lines changed

10 files changed

+32
-25
lines changed

api/v1alpha3/packetmachine_types.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1alpha3
1818

1919
import (
20+
metal "github.com/equinix-labs/metal-go/metal/v1"
2021
corev1 "k8s.io/api/core/v1"
2122
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2223
capierrors "sigs.k8s.io/cluster-api/errors"
@@ -30,10 +31,10 @@ const (
3031

3132
// PacketMachineSpec defines the desired state of PacketMachine.
3233
type PacketMachineSpec struct {
33-
OS string `json:"OS"` //nolint: tagliatelle
34-
BillingCycle string `json:"billingCycle"`
35-
MachineType string `json:"machineType"`
36-
SshKeys []string `json:"sshKeys,omitempty"`
34+
OS string `json:"OS"` //nolint: tagliatelle
35+
BillingCycle metal.DeviceCreateInputBillingCycle `json:"billingCycle,omitempty"`
36+
MachineType string `json:"machineType"`
37+
SshKeys []string `json:"sshKeys,omitempty"`
3738

3839
// Facility represents the Packet facility for this cluster.
3940
// Override from the PacketCluster spec.

api/v1alpha3/zz_generated.conversion.go

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/packetmachine_types.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
metal "github.com/equinix-labs/metal-go/metal/v1"
2021
corev1 "k8s.io/api/core/v1"
2122
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2223
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -53,10 +54,10 @@ const (
5354

5455
// PacketMachineSpec defines the desired state of PacketMachine.
5556
type PacketMachineSpec struct {
56-
OS string `json:"os"`
57-
BillingCycle string `json:"billingCycle"`
58-
MachineType string `json:"machineType"`
59-
SSHKeys []string `json:"sshKeys,omitempty"`
57+
OS string `json:"os"`
58+
BillingCycle metal.DeviceCreateInputBillingCycle `json:"billingCycle,omitempty"`
59+
MachineType string `json:"machineType"`
60+
SSHKeys []string `json:"sshKeys,omitempty"`
6061

6162
// Facility represents the Packet facility for this machine.
6263
// Override from the PacketCluster spec.

config/crd/bases/infrastructure.cluster.x-k8s.io_packetmachines.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ spec:
6262
OS:
6363
type: string
6464
billingCycle:
65+
description: DeviceCreateInputBillingCycle The billing cycle of the
66+
device.
6567
type: string
6668
facility:
6769
description: Facility represents the Packet facility for this cluster.
@@ -99,7 +101,6 @@ spec:
99101
type: array
100102
required:
101103
- OS
102-
- billingCycle
103104
- machineType
104105
type: object
105106
status:
@@ -197,6 +198,8 @@ spec:
197198
description: PacketMachineSpec defines the desired state of PacketMachine.
198199
properties:
199200
billingCycle:
201+
description: DeviceCreateInputBillingCycle The billing cycle of the
202+
device.
200203
type: string
201204
facility:
202205
description: Facility represents the Packet facility for this machine.
@@ -235,7 +238,6 @@ spec:
235238
type: string
236239
type: array
237240
required:
238-
- billingCycle
239241
- machineType
240242
- os
241243
type: object

config/crd/bases/infrastructure.cluster.x-k8s.io_packetmachinetemplates.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ spec:
5050
OS:
5151
type: string
5252
billingCycle:
53+
description: DeviceCreateInputBillingCycle The billing cycle
54+
of the device.
5355
type: string
5456
facility:
5557
description: Facility represents the Packet facility for this
@@ -88,7 +90,6 @@ spec:
8890
type: array
8991
required:
9092
- OS
91-
- billingCycle
9293
- machineType
9394
type: object
9495
required:
@@ -130,6 +131,8 @@ spec:
130131
of the machine.
131132
properties:
132133
billingCycle:
134+
description: DeviceCreateInputBillingCycle The billing cycle
135+
of the device.
133136
type: string
134137
facility:
135138
description: Facility represents the Packet facility for this
@@ -169,7 +172,6 @@ spec:
169172
type: string
170173
type: array
171174
required:
172-
- billingCycle
173175
- machineType
174176
- os
175177
type: object

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module sigs.k8s.io/cluster-api-provider-packet
33
go 1.19
44

55
require (
6-
github.com/equinix-labs/metal-go v0.21.0
6+
github.com/equinix-labs/metal-go v0.25.1
77
github.com/onsi/gomega v1.27.5
88
github.com/pkg/errors v0.9.1
99
github.com/spf13/cobra v1.6.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
101101
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
102102
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
103103
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
104-
github.com/equinix-labs/metal-go v0.21.0 h1:AWmciCaO+tjNKCKB0r4pMHpoGenzAqua3TbXA5VjZE8=
105-
github.com/equinix-labs/metal-go v0.21.0/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
104+
github.com/equinix-labs/metal-go v0.25.1 h1:uL83lRKyAcOfab+9r2xujAuLD8lTsqv89+SPvVFkcBM=
105+
github.com/equinix-labs/metal-go v0.25.1/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
106106
github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
107107
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
108108
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=

pkg/cloud/packet/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func (p *Client) EnableProjectBGP(ctx context.Context, projectID string) error {
302302
// - bgpConfig struct does not have Status=="disabled"
303303
if err != nil {
304304
return err
305-
} else if bgpConfig != nil && bgpConfig.GetId() != "" && strings.ToLower(bgpConfig.GetStatus()) != "disabled" {
305+
} else if bgpConfig != nil && bgpConfig.GetId() != "" && bgpConfig.GetStatus() != metal.BGPCONFIGSTATUS_DISABLED {
306306
return nil
307307
}
308308

@@ -341,7 +341,7 @@ func (p *Client) EnableProjectBGP(ctx context.Context, projectID string) error {
341341
// EnsureNodeBGPEnabled check if the node has bgp enabled, and set it if it does not.
342342
func (p *Client) EnsureNodeBGPEnabled(ctx context.Context, id string) error {
343343
// fortunately, this is idempotent, so just create
344-
addressFamily := "ipv4"
344+
addressFamily := metal.BGPSESSIONINPUTADDRESSFAMILY_IPV4
345345
req := metal.BGPSessionInput{
346346
AddressFamily: &addressFamily,
347347
}

test/e2e/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ replace (
88
)
99

1010
require (
11-
github.com/equinix-labs/metal-go v0.25.0
11+
github.com/equinix-labs/metal-go v0.25.1
1212
github.com/onsi/ginkgo/v2 v2.9.2
1313
github.com/onsi/gomega v1.27.5
1414
golang.org/x/crypto v0.12.0

test/e2e/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y
130130
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
131131
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
132132
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
133-
github.com/equinix-labs/metal-go v0.25.0 h1:AgMwoRYhfqPSkGu1FFLlyVCFBRy/xiBgnfiydMtw7jY=
134-
github.com/equinix-labs/metal-go v0.25.0/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
133+
github.com/equinix-labs/metal-go v0.25.1 h1:uL83lRKyAcOfab+9r2xujAuLD8lTsqv89+SPvVFkcBM=
134+
github.com/equinix-labs/metal-go v0.25.1/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
135135
github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
136136
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
137137
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=

0 commit comments

Comments
 (0)