Skip to content

Commit

Permalink
Merge pull request #664 from cprivitere/metal-go-bump
Browse files Browse the repository at this point in the history
🌱 bump metal-go to v0.25.0
  • Loading branch information
cprivitere committed Oct 27, 2023
2 parents dc74571 + 50d8d31 commit dbd1770
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 25 deletions.
9 changes: 5 additions & 4 deletions api/v1alpha3/packetmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha3

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

// PacketMachineSpec defines the desired state of PacketMachine.
type PacketMachineSpec struct {
OS string `json:"OS"` //nolint: tagliatelle
BillingCycle string `json:"billingCycle"`
MachineType string `json:"machineType"`
SshKeys []string `json:"sshKeys,omitempty"`
OS string `json:"OS"` //nolint: tagliatelle
BillingCycle metal.DeviceCreateInputBillingCycle `json:"billingCycle,omitempty"`
MachineType string `json:"machineType"`
SshKeys []string `json:"sshKeys,omitempty"`

// Facility represents the Packet facility for this cluster.
// Override from the PacketCluster spec.
Expand Down
11 changes: 6 additions & 5 deletions api/v1alpha3/zz_generated.conversion.go

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

9 changes: 5 additions & 4 deletions api/v1beta1/packetmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1beta1

import (
metal "github.com/equinix-labs/metal-go/metal/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
Expand Down Expand Up @@ -53,10 +54,10 @@ const (

// PacketMachineSpec defines the desired state of PacketMachine.
type PacketMachineSpec struct {
OS string `json:"os"`
BillingCycle string `json:"billingCycle"`
MachineType string `json:"machineType"`
SSHKeys []string `json:"sshKeys,omitempty"`
OS string `json:"os"`
BillingCycle metal.DeviceCreateInputBillingCycle `json:"billingCycle,omitempty"`
MachineType string `json:"machineType"`
SSHKeys []string `json:"sshKeys,omitempty"`

// Facility represents the Packet facility for this machine.
// Override from the PacketCluster spec.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
OS:
type: string
billingCycle:
description: DeviceCreateInputBillingCycle The billing cycle of the
device.
type: string
facility:
description: Facility represents the Packet facility for this cluster.
Expand Down Expand Up @@ -99,7 +101,6 @@ spec:
type: array
required:
- OS
- billingCycle
- machineType
type: object
status:
Expand Down Expand Up @@ -197,6 +198,8 @@ spec:
description: PacketMachineSpec defines the desired state of PacketMachine.
properties:
billingCycle:
description: DeviceCreateInputBillingCycle The billing cycle of the
device.
type: string
facility:
description: Facility represents the Packet facility for this machine.
Expand Down Expand Up @@ -235,7 +238,6 @@ spec:
type: string
type: array
required:
- billingCycle
- machineType
- os
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ spec:
OS:
type: string
billingCycle:
description: DeviceCreateInputBillingCycle The billing cycle
of the device.
type: string
facility:
description: Facility represents the Packet facility for this
Expand Down Expand Up @@ -88,7 +90,6 @@ spec:
type: array
required:
- OS
- billingCycle
- machineType
type: object
required:
Expand Down Expand Up @@ -130,6 +131,8 @@ spec:
of the machine.
properties:
billingCycle:
description: DeviceCreateInputBillingCycle The billing cycle
of the device.
type: string
facility:
description: Facility represents the Packet facility for this
Expand Down Expand Up @@ -169,7 +172,6 @@ spec:
type: string
type: array
required:
- billingCycle
- machineType
- os
type: object
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module sigs.k8s.io/cluster-api-provider-packet
go 1.19

require (
github.com/equinix-labs/metal-go v0.21.0
github.com/equinix-labs/metal-go v0.25.1
github.com/onsi/gomega v1.27.5
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.6.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/equinix-labs/metal-go v0.21.0 h1:AWmciCaO+tjNKCKB0r4pMHpoGenzAqua3TbXA5VjZE8=
github.com/equinix-labs/metal-go v0.21.0/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
github.com/equinix-labs/metal-go v0.25.1 h1:uL83lRKyAcOfab+9r2xujAuLD8lTsqv89+SPvVFkcBM=
github.com/equinix-labs/metal-go v0.25.1/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/packet/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (p *Client) EnableProjectBGP(ctx context.Context, projectID string) error {
// - bgpConfig struct does not have Status=="disabled"
if err != nil {
return err
} else if bgpConfig != nil && bgpConfig.GetId() != "" && strings.ToLower(bgpConfig.GetStatus()) != "disabled" {
} else if bgpConfig != nil && bgpConfig.GetId() != "" && bgpConfig.GetStatus() != metal.BGPCONFIGSTATUS_DISABLED {
return nil
}

Expand Down Expand Up @@ -341,7 +341,7 @@ func (p *Client) EnableProjectBGP(ctx context.Context, projectID string) error {
// EnsureNodeBGPEnabled check if the node has bgp enabled, and set it if it does not.
func (p *Client) EnsureNodeBGPEnabled(ctx context.Context, id string) error {
// fortunately, this is idempotent, so just create
addressFamily := "ipv4"
addressFamily := metal.BGPSESSIONINPUTADDRESSFAMILY_IPV4
req := metal.BGPSessionInput{
AddressFamily: &addressFamily,
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ replace (
)

require (
github.com/equinix-labs/metal-go v0.25.0
github.com/equinix-labs/metal-go v0.25.1
github.com/onsi/ginkgo/v2 v2.9.2
github.com/onsi/gomega v1.27.5
golang.org/x/crypto v0.12.0
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/equinix-labs/metal-go v0.25.0 h1:AgMwoRYhfqPSkGu1FFLlyVCFBRy/xiBgnfiydMtw7jY=
github.com/equinix-labs/metal-go v0.25.0/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
github.com/equinix-labs/metal-go v0.25.1 h1:uL83lRKyAcOfab+9r2xujAuLD8lTsqv89+SPvVFkcBM=
github.com/equinix-labs/metal-go v0.25.1/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
Expand Down

0 comments on commit dbd1770

Please sign in to comment.