Skip to content

Commit

Permalink
upgrade to capi 1.7, k8s 1.29 (#686)
Browse files Browse the repository at this point in the history
* upgrade to capi 1.7, k8s 1.29

Signed-off-by: dkomsa <[email protected]>

* linting fixes

Signed-off-by: dkomsa <[email protected]>

* update test configs for capi 1.7

---------

Signed-off-by: dkomsa <[email protected]>
  • Loading branch information
d-honeybadger authored Feb 21, 2025
1 parent 1626d03 commit cb16540
Show file tree
Hide file tree
Showing 24 changed files with 364 additions and 755 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:

- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: "1.21"
go-version: "1.22"
check-latest: true
cache: false

- name: golangci-lint
uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347 # v6.3.2
with:
version: "v1.57"
version: "v1.64"
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ linters:
- bodyclose
- dogsled
- errcheck
- exportloopref
- goconst
- gocritic
- gocyclo
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ ENVSUBST_VER := v1.2.0
ENVSUBST_BIN := envsubst
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)

GOLANGCI_LINT_VER := v1.57.2
GOLANGCI_LINT_VER := v1.64.5
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

KUSTOMIZE_VER := v4.5.7
KUSTOMIZE_BIN := kustomize
KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER)

MOCKGEN_VER := v1.5.0
MOCKGEN_VER := v0.5.0
MOCKGEN_BIN := mockgen
MOCKGEN := $(TOOLS_BIN_DIR)/$(MOCKGEN_BIN)-$(MOCKGEN_VER)

Expand All @@ -154,7 +154,7 @@ GINKGO_BIN := ginkgo
GINKGO := $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINKGO_VER)
GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo

KUBECTL_VER := v1.28.9
KUBECTL_VER := v1.29.13
KUBECTL_BIN := $(TOOLS_BIN_DIR)/kubectl
KUBECTL := $(KUBECTL_BIN)-$(KUBECTL_VER)

Expand Down Expand Up @@ -224,7 +224,7 @@ $(KUSTOMIZE): ## Build kustomize from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) sigs.k8s.io/kustomize/kustomize/v4 $(KUSTOMIZE_BIN) $(KUSTOMIZE_VER)

$(MOCKGEN): ## Build mockgen from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) github.com/golang/mock/mockgen $(MOCKGEN_BIN) $(MOCKGEN_VER)
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) go.uber.org/mock/mockgen $(MOCKGEN_BIN) $(MOCKGEN_VER)

$(RELEASE_NOTES): ## Build release notes.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) k8s.io/release/cmd/release-notes $(RELEASE_NOTES_BIN) $(RELEASE_NOTES_VER)
Expand Down Expand Up @@ -298,7 +298,7 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
.PHONY: docker-pull-prerequisites
docker-pull-prerequisites:
docker pull docker/dockerfile:1.1-experimental
docker pull docker.io/library/golang:1.21.9
docker pull docker.io/library/golang:1.22.12
docker pull gcr.io/distroless/static:latest

.PHONY: docker-build
Expand Down
4 changes: 2 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ settings = {
"deploy_cert_manager": True,
"preload_images_for_kind": True,
"kind_cluster_name": "capdo",
"capi_version": "v1.6.4",
"capi_version": "v1.7.9",
"cert_manager_version": "v1.14.4",
"kubernetes_version": "v1.29.4",
"kubernetes_version": "v1.29.13",
}

keys = ["DO_B64ENCODED_CREDENTIALS"]
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha4/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type DOLoadBalancer struct {
// +optional
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
Port int `json:"port,omitempty"`
Port int32 `json:"port,omitempty"`
// The API Server load balancing algorithm used to determine which backend Droplet will be selected by a client.
// It must be either "round_robin" or "least_connections". The default value is "round_robin".
// +optional
Expand Down Expand Up @@ -146,7 +146,7 @@ type DOVolume struct {

var (
// DefaultLBPort default LoadBalancer port.
DefaultLBPort = 6443
DefaultLBPort int32 = 6443
// DefaultLBAlgorithm default LoadBalancer algorithm.
DefaultLBAlgorithm = "round_robin"
// DefaultLBHealthCheckInterval default LoadBalancer health check interval.
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type DOLoadBalancer struct {
// +optional
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
Port int `json:"port,omitempty"`
Port int32 `json:"port,omitempty"`
// The API Server load balancing algorithm used to determine which backend Droplet will be selected by a client.
// It must be either "round_robin" or "least_connections". The default value is "round_robin".
// +optional
Expand Down Expand Up @@ -146,7 +146,7 @@ type DOVolume struct {

var (
// DefaultLBPort default LoadBalancer port.
DefaultLBPort = 6443
DefaultLBPort int32 = 6443
// DefaultLBAlgorithm default LoadBalancer algorithm.
DefaultLBAlgorithm = "round_robin"
// DefaultLBHealthCheckInterval default LoadBalancer health check interval.
Expand Down
2 changes: 1 addition & 1 deletion cloud/services/computes/droplets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"testing"

"github.com/digitalocean/godo"
"github.com/golang/mock/gomock"
"github.com/pkg/errors"
"go.uber.org/mock/gomock"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
34 changes: 20 additions & 14 deletions cloud/services/computes/mock_computes/droplets_mock.go

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

Loading

0 comments on commit cb16540

Please sign in to comment.