Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix upgrade tests #386

Merged
merged 5 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ E2E_DIR ?= $(REPO_ROOT)/test/e2e
KUBETEST_CONF_PATH ?= $(abspath $(E2E_DIR)/data/kubetest/conformance.yaml)
E2E_CONF_FILE_SOURCE ?= $(E2E_DIR)/config/packet-ci.yaml
E2E_CONF_FILE ?= $(E2E_DIR)/config/packet-ci-envsubst.yaml
E2E_LD_FLAGS ?= "-X 'sigs.k8s.io/cluster-api-provider-packet/pkg/cloud/packet.clientName=capp-e2e' -X 'sigs.k8s.io/cluster-api-provider-packet/pkg/cloud/packet.clientUAFormat=capp-e2e/%s %s'"

.PHONY: $(E2E_CONF_FILE)
$(E2E_CONF_FILE): $(ENVSUBST) $(E2E_CONF_FILE_SOURCE)
Expand All @@ -160,7 +159,6 @@ run-e2e-tests: $(KUBECTL) $(KUSTOMIZE) $(KIND) $(GINKGO) $(E2E_CONF_FILE) e2e-te
$(MAKE) set-manifest-image MANIFEST_IMG=$(REGISTRY)/$(IMAGE_NAME) MANIFEST_TAG=$(TAG)
$(MAKE) set-manifest-pull-policy PULL_POLICY=IfNotPresent
cd test/e2e; time $(GINKGO) -v -trace -progress -v -tags=e2e \
-ldflags $(E2E_LD_FLAGS) \
--randomizeAllSpecs -race $(GINKGO_ADDITIONAL_ARGS) \
-focus=$(GINKGO_FOCUS) -skip=$(GINKGO_SKIP) \
-nodes=$(GINKGO_NODES) --noColor=$(GINKGO_NOCOLOR) \
Expand Down
2 changes: 1 addition & 1 deletion clusterctl-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "infrastructure-packet",
"config": {
"componentsFile": "infrastructure-components.yaml",
"nextVersion": "v0.5.0"
"nextVersion": "v1.1.99"
}
}

11 changes: 5 additions & 6 deletions cmd/ci-clean/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/spf13/cobra"
kerrors "k8s.io/apimachinery/pkg/util/errors"

"sigs.k8s.io/cluster-api-provider-packet/version"
"sigs.k8s.io/cluster-api-provider-packet/pkg/cloud/packet"
)

const (
Expand Down Expand Up @@ -65,8 +65,7 @@ func main() {
}

func cleanup(metalAuthToken, metalProjectID string) error {
metalClient := packngo.NewClientWithAuth("capp-e2e", metalAuthToken, nil)
metalClient.UserAgent = fmt.Sprintf("capp-e2e/%s %s", version.Get(), metalClient.UserAgent)
metalClient := packet.NewClient(metalAuthToken)
listOpts := &packngo.ListOptions{}
var errs []error

Expand Down Expand Up @@ -100,7 +99,7 @@ func cleanup(metalAuthToken, metalProjectID string) error {
return kerrors.NewAggregate(errs)
}

func deleteDevices(metalClient *packngo.Client, devices []packngo.Device) error {
func deleteDevices(metalClient *packet.Client, devices []packngo.Device) error {
var errs []error

for _, d := range devices {
Expand All @@ -121,7 +120,7 @@ func deleteDevices(metalClient *packngo.Client, devices []packngo.Device) error
return kerrors.NewAggregate(errs)
}

func deleteIPs(metalClient *packngo.Client, ips []packngo.IPAddressReservation) error {
func deleteIPs(metalClient *packet.Client, ips []packngo.IPAddressReservation) error {
var errs []error

for _, ip := range ips {
Expand Down Expand Up @@ -149,7 +148,7 @@ func deleteIPs(metalClient *packngo.Client, ips []packngo.IPAddressReservation)
return kerrors.NewAggregate(errs)
}

func deleteKeys(metalClient *packngo.Client, keys []packngo.SSHKey) error {
func deleteKeys(metalClient *packet.Client, keys []packngo.SSHKey) error {
var errs []error

for _, k := range keys {
Expand Down
8 changes: 4 additions & 4 deletions pkg/cloud/packet/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func GetClient() (*Client, error) {
}

func (p *Client) GetDevice(deviceID string) (*packngo.Device, error) {
dev, _, err := p.Client.Devices.Get(deviceID, nil)
dev, _, err := p.Devices.Get(deviceID, nil)
return dev, err
}

Expand Down Expand Up @@ -121,7 +121,7 @@ func (p *Client) NewDevice(ctx context.Context, req CreateDeviceRequest) (*packn

if req.MachineScope.IsControlPlane() {
// control plane machines should get the API key injected
userDataValues["apiKey"] = p.Client.APIKey
userDataValues["apiKey"] = p.APIKey

if req.ControlPlaneEndpoint != "" {
userDataValues["controlPlaneEndpoint"] = req.ControlPlaneEndpoint
Expand Down Expand Up @@ -160,7 +160,7 @@ func (p *Client) NewDevice(ctx context.Context, req CreateDeviceRequest) (*packn

// If there are no reservationIDs to process, go ahead and return early
if len(reservationIDs) == 0 {
dev, _, err := p.Client.Devices.Create(serverCreateOpts)
dev, _, err := p.Devices.Create(serverCreateOpts)
return dev, err
}

Expand All @@ -171,7 +171,7 @@ func (p *Client) NewDevice(ctx context.Context, req CreateDeviceRequest) (*packn

for _, resID := range reservationIDs {
serverCreateOpts.HardwareReservationID = resID
dev, _, err := p.Client.Devices.Create(serverCreateOpts)
dev, _, err := p.Devices.Create(serverCreateOpts)
if err != nil {
lastErr = err
continue
Expand Down