Skip to content

Commit c8ae152

Browse files
committed
update tooling, go version 1.24
1 parent f233f6c commit c8ae152

File tree

14 files changed

+277
-125
lines changed

14 files changed

+277
-125
lines changed

.github/workflows/chart-lint-and-test.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,10 @@ jobs:
1616

1717
- uses: jetify-com/devbox-install-action@22b0f5500b14df4ea357ce673fbd4ced940ed6a1 # tag=v0.13.0
1818

19-
- name: Setup Chart Linting
20-
id: lint
21-
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # tag=v2.7.0
22-
with:
23-
version: v3.7.1
24-
25-
- name: Run docs-testing (helm-docs)
19+
- name: Verify Helm docs updated
2620
id: helm-docs
2721
run: |
28-
./scripts/helm-docs.sh
22+
devbox run -- helm-docs
2923
if [[ $(git diff --stat) != '' ]]; then
3024
echo -e '\033[0;31mDocumentation outdated!\033[0m ❌'
3125
git diff --color
@@ -38,20 +32,20 @@ jobs:
3832
id: list-changed
3933
run: |
4034
## If executed with debug this won't work anymore.
41-
changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed)
35+
changed=$(devbox run -- ct --config ./.github/configs/ct-lint.yaml list-changed)
4236
if [[ -n "$changed" ]]; then
4337
echo "changed=true >> $GITHUB_OUTPUT"
4438
fi
4539
4640
- name: Run chart-testing (lint)
47-
run: ct lint --config ./.github/configs/ct-lint.yaml
41+
run: devbox run -- ct lint --config ./.github/configs/ct-lint.yaml
4842

4943
- name: Create kind cluster
5044
uses: helm/kind-action@v1.12.0
5145
if: steps.list-changed.outputs.changed == 'true'
5246

5347
- name: Run chart-testing (install)
54-
run: ct install
48+
run: devbox run -- ct install
5549
if: steps.list-changed.outputs.changed == 'true'
5650

5751
# Check CRD update

.golangci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ linters-settings:
1212
- performance
1313
- style
1414
govet:
15-
check-shadowing: true
15+
shadow: true
1616
enable:
1717
- fieldalignment
1818
nolintlint:
@@ -24,7 +24,7 @@ linters-settings:
2424
arguments:
2525
- allowedPackages:
2626
- github.com/onsi/ginkgo/v2
27-
- github.com/onsi/gomega
27+
- github.com/onsi/gomega
2828
gosec:
2929
excludes:
3030
- G115
@@ -36,7 +36,6 @@ linters:
3636
- dogsled
3737
- dupl
3838
- errcheck
39-
- exportloopref
4039
- exhaustive
4140
- goconst
4241
- gocritic

Makefile

Lines changed: 21 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ include Makefile.local
3232
# Image URL to use all building/pushing image targets
3333
IMG ?= ghcr.io/tv2-oss/bifrost-gateway-controller:latest
3434
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
35-
ENVTEST_K8S_VERSION = 1.30.0
35+
ENVTEST_K8S_VERSION = 1.32.0
3636

3737
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
3838
ifeq (,$(shell go env GOBIN))
@@ -69,12 +69,12 @@ help: ## Display this help.
6969
##@ Development
7070

7171
.PHONY: manifests
72-
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
73-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
72+
manifests: ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
73+
controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
7474

7575
.PHONY: generate
76-
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
77-
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
76+
generate: ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
77+
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
7878

7979
.PHONY: fmt
8080
fmt: ## Run go fmt against code.
@@ -85,15 +85,15 @@ vet: ## Run go vet against code.
8585
go vet ./...
8686

8787
.PHONY: test
88-
test: manifests generate fmt vet envtest ## Run tests.
89-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
88+
test: manifests generate fmt vet ## Run tests.
89+
KUBEBUILDER_ASSETS="$(shell setup-envtest use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
9090

9191
.PHONY: test-ginkgo
92-
test-ginkgo: manifests generate fmt vet envtest ## Run tests using ginkgo.
93-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" ginkgo -vv ./... -coverprofile cover.out
92+
test-ginkgo: manifests generate fmt vet ## Run tests using ginkgo.
93+
KUBEBUILDER_ASSETS="$(shell setup-envtest use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" ginkgo -vv ./... -coverprofile cover.out
9494

9595
.PHONY: e2e-test
96-
e2e-test: envtest
96+
e2e-test:
9797
(cd test/e2e/ && USE_EXISTING_CLUSTER=true go test)
9898

9999
.PHONY: unit-test
@@ -127,10 +127,10 @@ run: manifests generate fmt vet ## Run a controller from your host.
127127
go run ./main.go
128128

129129
.PHONY: manifest-build
130-
manifest-build: kustomize
130+
manifest-build:
131131
mkdir config/release
132-
$(KUSTOMIZE) build config/crd -o config/release/crds.yaml
133-
$(KUSTOMIZE) build config/default -o config/release/install.yaml
132+
kustomize build config/crd -o config/release/crds.yaml
133+
kustomize build config/default -o config/release/install.yaml
134134

135135
# If you wish built the manager image targeting other platforms you can use the --platform flag.
136136
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
@@ -167,21 +167,21 @@ ifndef ignore-not-found
167167
endif
168168

169169
.PHONY: install
170-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
171-
$(KUSTOMIZE) build config/crd | kubectl apply -f -
170+
install: manifests ## Install CRDs into the K8s cluster specified in ~/.kube/config.
171+
kustomize build config/crd | kubectl apply -f -
172172

173173
.PHONY: uninstall
174-
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
175-
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
174+
uninstall: manifests ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
175+
kustomize build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
176176

177177
.PHONY: deploy
178-
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
179-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
180-
$(KUSTOMIZE) build config/kind | kubectl apply -f -
178+
deploy: manifests ## Deploy controller to the K8s cluster specified in ~/.kube/config.
179+
cd config/manager && kustomize edit set image controller=${IMG}
180+
kustomize build config/kind | kubectl apply -f -
181181

182182
.PHONY: undeploy
183183
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
184-
$(KUSTOMIZE) build config/kind | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
184+
kustomize build config/kind | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
185185

186186
##@ Build Dependencies
187187

@@ -190,32 +190,6 @@ LOCALBIN ?= $(shell pwd)/bin
190190
$(LOCALBIN):
191191
mkdir -p $(LOCALBIN)
192192

193-
## Tool Binaries
194-
KUSTOMIZE ?= $(LOCALBIN)/kustomize
195-
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
196-
ENVTEST ?= $(LOCALBIN)/setup-envtest
197-
198-
## Tool Versions
199-
KUSTOMIZE_VERSION ?= v4.5.5
200-
CONTROLLER_TOOLS_VERSION ?= v0.16.5
201-
ENVTEST_VERSION ?= release-0.19
202-
203-
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
204-
.PHONY: kustomize
205-
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
206-
$(KUSTOMIZE): $(LOCALBIN)
207-
test -s $(LOCALBIN)/kustomize || { curl -Ss $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }
208-
209-
.PHONY: controller-gen
210-
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
211-
$(CONTROLLER_GEN): $(LOCALBIN)
212-
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
213-
214-
.PHONY: envtest
215-
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
216-
$(ENVTEST): $(LOCALBIN)
217-
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_VERSION)
218-
219193
.PHONY: lint
220194
lint:
221195
golangci-lint run -v --timeout 10m

charts/bifrost-gateway-controller/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: bifrost-gateway-controller-helm
33
description: Gateway API driven management of network infrastructure across Kubernetes and cloud infrastructure
44
type: application
5-
version: 0.1.10
5+
version: 0.1.11
66
appVersion: "0.0.21"

charts/bifrost-gateway-controller/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ Gateway API driven management of network infrastructure across Kubernetes and cl
3838
| serviceAccount.create | bool | `true` | |
3939

4040
----------------------------------------------
41-
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
41+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

config/crd/bases/gateway.tv2.dk_gatewayclassblueprints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.5
6+
controller-gen.kubebuilder.io/version: v0.16.4
77
name: gatewayclassblueprints.gateway.tv2.dk
88
spec:
99
group: gateway.tv2.dk

config/crd/bases/gateway.tv2.dk_gatewayclassconfigs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.5
6+
controller-gen.kubebuilder.io/version: v0.16.4
77
name: gatewayclassconfigs.gateway.tv2.dk
88
spec:
99
group: gateway.tv2.dk

config/crd/bases/gateway.tv2.dk_gatewayconfigs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.5
6+
controller-gen.kubebuilder.io/version: v0.16.4
77
name: gatewayconfigs.gateway.tv2.dk
88
spec:
99
group: gateway.tv2.dk

config/release/crds.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
controller-gen.kubebuilder.io/version: v0.16.5
5+
controller-gen.kubebuilder.io/version: v0.16.4
66
name: gatewayclassblueprints.gateway.tv2.dk
77
spec:
88
group: gateway.tv2.dk
@@ -162,7 +162,7 @@ apiVersion: apiextensions.k8s.io/v1
162162
kind: CustomResourceDefinition
163163
metadata:
164164
annotations:
165-
controller-gen.kubebuilder.io/version: v0.16.5
165+
controller-gen.kubebuilder.io/version: v0.16.4
166166
labels:
167167
gateway.networking.k8s.io/policy: "true"
168168
name: gatewayclassconfigs.gateway.tv2.dk
@@ -326,7 +326,7 @@ apiVersion: apiextensions.k8s.io/v1
326326
kind: CustomResourceDefinition
327327
metadata:
328328
annotations:
329-
controller-gen.kubebuilder.io/version: v0.16.5
329+
controller-gen.kubebuilder.io/version: v0.16.4
330330
labels:
331331
gateway.networking.k8s.io/policy: "true"
332332
name: gatewayconfigs.gateway.tv2.dk

config/release/install.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ apiVersion: apiextensions.k8s.io/v1
1515
kind: CustomResourceDefinition
1616
metadata:
1717
annotations:
18-
controller-gen.kubebuilder.io/version: v0.16.5
18+
controller-gen.kubebuilder.io/version: v0.16.4
1919
name: gatewayclassblueprints.gateway.tv2.dk
2020
spec:
2121
group: gateway.tv2.dk
@@ -175,7 +175,7 @@ apiVersion: apiextensions.k8s.io/v1
175175
kind: CustomResourceDefinition
176176
metadata:
177177
annotations:
178-
controller-gen.kubebuilder.io/version: v0.16.5
178+
controller-gen.kubebuilder.io/version: v0.16.4
179179
labels:
180180
gateway.networking.k8s.io/policy: "true"
181181
name: gatewayclassconfigs.gateway.tv2.dk
@@ -339,7 +339,7 @@ apiVersion: apiextensions.k8s.io/v1
339339
kind: CustomResourceDefinition
340340
metadata:
341341
annotations:
342-
controller-gen.kubebuilder.io/version: v0.16.5
342+
controller-gen.kubebuilder.io/version: v0.16.4
343343
labels:
344344
gateway.networking.k8s.io/policy: "true"
345345
name: gatewayconfigs.gateway.tv2.dk

0 commit comments

Comments
 (0)