Skip to content

Commit

Permalink
upgrade to capi 1.6.x (#587)
Browse files Browse the repository at this point in the history
* upgrade to capi 1.6.x

Signed-off-by: cpanato <ctadeu@gmail.com>

* update machine images

Signed-off-by: cpanato <ctadeu@gmail.com>

---------

Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato authored Apr 26, 2024
1 parent e63b554 commit baf37fe
Show file tree
Hide file tree
Showing 48 changed files with 496 additions and 3,292 deletions.
24 changes: 17 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2
updates:
- package-ecosystem: gomod
Expand All @@ -9,13 +10,17 @@ updates:
- "release-note-none"
- "ok-to-test"
ignore:
# Ignore controller-runtime as its upgraded manually.
- dependency-name: "sigs.k8s.io/controller-runtime"
# Ignore sigs.k8s.io/cluster-api as its upgraded manually.
- dependency-name: "sigs.k8s.io/cluster-api/*"
# Ignore k8s and its transitives modules as they are upgraded manually
# together with controller-runtime.
- dependency-name: "k8s.io/*"
# Ignore controller-runtime as its upgraded manually.
- dependency-name: "sigs.k8s.io/controller-runtime"
# Ignore sigs.k8s.io/cluster-api as its upgraded manually.
- dependency-name: "sigs.k8s.io/cluster-api/*"
# Ignore k8s and its transitives modules as they are upgraded manually
# together with controller-runtime.
- dependency-name: "k8s.io/*"
groups:
gomod:
update-types:
- "patch"

- package-ecosystem: "docker"
directory: "/"
Expand All @@ -34,3 +39,8 @@ updates:
- "area/dependency"
- "release-note-none"
- "ok-to-test"
groups:
actions:
update-types:
- "patch"
- "minor"
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@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true
cache: false

- name: golangci-lint
uses: golangci/golangci-lint-action@82d40c283aeb1f2b6595839195e95c2d6a49081b # v5.0.0
with:
version: "v1.54"
version: "v1.57"
16 changes: 5 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ linters:
- nolintlint
- prealloc
- revive
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
Expand Down Expand Up @@ -53,12 +51,13 @@ linters-settings:
# Controller Runtime
- pkg: sigs.k8s.io/controller-runtime
alias: ctrl
staticcheck:
go: "1.20"
stylecheck:
go: "1.20"

issues:
exclude-files:
- "zz_generated.*\\.go$"
- ".*conversion.*\\.go$"
exclude-dirs:
- mock*
max-same-issues: 0
max-issues-per-linter: 0
# We are disabling default golangci exclusions because we want to help reviewers to focus on reviewing the most relevant
Expand Down Expand Up @@ -121,9 +120,4 @@ issues:

run:
timeout: 10m
skip-files:
- "zz_generated.*\\.go$"
- ".*conversion.*\\.go$"
skip-dirs:
- mock*
allow-parallel-runners: true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Build the manager binary
FROM golang:1.20.10@sha256:ed6c4a5918b0a1ffb97970f6493d742dc5c7ebf3ccbd417c215d52830b57b994 as builder
FROM golang:1.21.9@sha256:81811f8a883e238666dbadee6928ae2902243a3cd3f3e860f21c102543c6b5a7 as builder
WORKDIR /workspace

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
Expand Down
23 changes: 10 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,23 @@ help: ## Display this help
## --------------------------------------

# Binaries.
CONTROLLER_GEN_VER := v0.8.0
CONTROLLER_GEN_VER := v0.13.0
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)

CONVERSION_GEN_VER := v0.22.2
CONVERSION_GEN_VER := v0.28.6
CONVERSION_GEN_BIN := conversion-gen
CONVERSION_GEN := $(TOOLS_BIN_DIR)/$(CONVERSION_GEN_BIN)-$(CONVERSION_GEN_VER)

ENVSUBST_VER := v1.2.0
ENVSUBST_BIN := envsubst
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)

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

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

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

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

Expand Down Expand Up @@ -266,14 +266,9 @@ generate: ## Generate code
.PHONY: generate-go
generate-go: $(CONTROLLER_GEN) $(CONVERSION_GEN) $(MOCKGEN) ## Runs Go related generate targets
$(CONTROLLER_GEN) \
paths=./api/... \
paths=./ \
paths=./... \
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt
$(CONVERSION_GEN) \
--input-dirs=./api/v1alpha3 \
--build-tag=ignore_autogenerated_core_v1alpha3 \
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \
--output-file-base=zz_generated.conversion \
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt $(OUTPUT_BASE)
$(CONVERSION_GEN) \
--input-dirs=./api/v1alpha4 \
--build-tag=ignore_autogenerated_core_v1alpha4 \
Expand All @@ -285,13 +280,15 @@ generate-go: $(CONTROLLER_GEN) $(CONVERSION_GEN) $(MOCKGEN) ## Runs Go related g
.PHONY: generate-manifests
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) \
paths=./ \
paths=./api/... \
crd:crdVersions=v1 \
rbac:roleName=manager-role \
output:crd:dir=$(CRD_ROOT) \
output:webhook:dir=$(WEBHOOK_ROOT) \
webhook
$(CONTROLLER_GEN) \
paths=./ \
paths=./controllers/... \
output:rbac:dir=$(RBAC_ROOT) \
rbac:roleName=manager-role
Expand All @@ -303,7 +300,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.20.8
docker pull docker.io/library/golang:1.21.9
docker pull gcr.io/distroless/static:latest

.PHONY: docker-build
Expand Down
10 changes: 0 additions & 10 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ version: "3"
domain: cluster.x-k8s.io
repo: sigs.k8s.io/cluster-api-provider-digitalocean
resources:
# v1alpha3 types
- group: infrastructure
kind: DOCluster
version: v1alpha3
- group: infrastructure
kind: DOMachine
version: v1alpha3
- group: infrastructure
kind: DOMachineTemplate
version: v1alpha3
# v1alpha4 types
- group: infrastructure
kind: DOCluster
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.5.2",
"capi_version": "v1.6.4",
"cert_manager_version": "v1.10.1",
"kubernetes_version": "v1.25.5",
"kubernetes_version": "v1.29.4",
}

keys = ["DO_B64ENCODED_CREDENTIALS"]
Expand Down
20 changes: 0 additions & 20 deletions api/v1alpha3/doc.go

This file was deleted.

67 changes: 0 additions & 67 deletions api/v1alpha3/docluster_conversion.go

This file was deleted.

103 changes: 0 additions & 103 deletions api/v1alpha3/docluster_types.go

This file was deleted.

Loading

0 comments on commit baf37fe

Please sign in to comment.