Skip to content

Commit

Permalink
[improvement] Migrate to new kubebuilder layout for webhooks and cont…
Browse files Browse the repository at this point in the history
…roller code (#574)

* Migrate to new kubebuilder layout for webhooks and controller code.

* Update dockerfile

* Update envtest suite tests

* Update the tiltfile config for docker image builds

* Update golangci config to exclude webhook test suite
  • Loading branch information
komer3 authored Nov 20, 2024
1 parent 46f9f21 commit 3b20368
Show file tree
Hide file tree
Showing 56 changed files with 857 additions and 545 deletions.
5 changes: 4 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ issues:
- path: cmd/main.go
linters:
- gci
- path: controller/suite_test.go
- path: internal/controller/suite_test.go
linters:
- gci
- path: internal/webhook/v1alpha2/webhook_suite_test.go
linters:
- gci
# Exclude goimports check for controller tests that import both mocktest and ginkgo/gomega as dot imports.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN go mod download
COPY cmd/main.go cmd/main.go
COPY api/ api/
COPY clients/ clients/
COPY controller/ controller/
COPY internal/ internal/
COPY cloud/ cloud/
COPY observability/ observability/
COPY util/ util/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ GOWRAP ?= $(CACHE_BIN)/gowrap
S5CMD ?= $(CACHE_BIN)/s5cmd

## Tool Versions
KUSTOMIZE_VERSION ?= v5.4.1
KUSTOMIZE_VERSION ?= v5.4.3
CTLPTL_VERSION ?= v0.8.29
CLUSTERCTL_VERSION ?= v1.7.2
KUBECTL_VERSION ?= v1.28.0
Expand Down
4 changes: 2 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if debug == "true":
local_resource(
"capl-compile",
'GOOS=linux CGO_ENABLED=0 go build -gcflags "-N -l" -ldflags="-X github.com/linode/cluster-api-provider-linode/version.version=$VERSION" -a -o bin/manager ./cmd/main.go',
deps=["./main.go", "./start.go", "vendor", "go.mod", "go.sum", "./api", "./cloud", "./cmd", "./controller",
deps=["./main.go", "./start.go", "vendor", "go.mod", "go.sum", "./api", "./cloud", "./cmd", "./internal",
"./observability", "./util", "./version",],
labels=["CAPL"],
)
Expand Down Expand Up @@ -210,7 +210,7 @@ if os.getenv("SKIP_DOCKER_BUILD", "false") != "true" and debug != "true":
"docker.io/linode/cluster-api-provider-linode",
context=".",
only=("Dockerfile", "Makefile", "vendor", "go.mod", "go.sum",
"./api", "./clients", "./cloud", "./cmd", "./controller", "./observability", "./util", "./version"),
"./api", "./clients", "./cloud", "./cmd", "./internal", "./observability", "./util", "./version"),
build_args={"VERSION": os.getenv("VERSION", "")},
)

Expand Down
28 changes: 0 additions & 28 deletions api/v1alpha2/linodeclustertemplate_webhook.go

This file was deleted.

33 changes: 0 additions & 33 deletions api/v1alpha2/linodeclustertemplate_webhook_test.go

This file was deleted.

28 changes: 0 additions & 28 deletions api/v1alpha2/linodemachinetemplate_webhook.go

This file was deleted.

33 changes: 0 additions & 33 deletions api/v1alpha2/linodemachinetemplate_webhook_test.go

This file was deleted.

112 changes: 0 additions & 112 deletions api/v1alpha2/linodeobjectstoragebucket_webhook.go

This file was deleted.

109 changes: 0 additions & 109 deletions api/v1alpha2/linodeobjectstoragekey_webhook.go

This file was deleted.

Loading

0 comments on commit 3b20368

Please sign in to comment.