Add Gateway API CRDs to controller test data (#340)

The PR #335 is adding controller tests for the HTTP route which means it
needs the CRDs. So simplify future testing work we will vendor the CRDs
from the release inside of the testdata directory. This is setup so that
changes to the GW API version will force generate to be run again.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated the generated Gateway API artifacts used in the build pipeline
to ensure the latest `standard-install.yaml` content is bundled.
* Kept the bundled Gateway API version synchronized automatically by
deriving it from the project’s module version and regenerating the asset
when dependencies change.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Philip Laine
2026-06-25 10:45:09 +02:00
committed by GitHub
parent 447bbc76cd
commit 84e9bff602
2 changed files with 17532 additions and 1 deletions
+5 -1
View File
@@ -15,7 +15,7 @@ IMG_TAG ?= dev
IMG_REF := $(IMG_REGISTRY)/$(IMG_REPOSITORY):$(IMG_TAG)
.PHONY: generate
generate: api/v1/zz_generated.deepcopy.go api/v1alpha1/zz_generated.deepcopy.go pkg/applyconfigurations config/crd/bases charts/netbird-operator/crds docs/api-reference.md
generate: api/v1/zz_generated.deepcopy.go api/v1alpha1/zz_generated.deepcopy.go pkg/applyconfigurations config/crd/bases charts/netbird-operator/crds docs/api-reference.md internal/controller/testdata/crd/gateway-api.yaml
api/v1/zz_generated.deepcopy.go api/v1alpha1/zz_generated.deepcopy.go: $(shell find api -not -name 'zz_generated*') hack/boilerplate.go.txt
@go tool controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
@@ -36,6 +36,10 @@ charts/netbird-operator/crds: $(GENERATED_CRDS)
docs/api-reference.md: $(shell find api) docs/.crd-ref-docs.yaml
@go tool crd-ref-docs --log-level error --output-path docs/api-reference.md --renderer markdown --source-path api/v1alpha1 --config docs/.crd-ref-docs.yaml
GATEWAY_API_VERSION = $(shell go list -m -f '{{.Version}}' sigs.k8s.io/gateway-api)
internal/controller/testdata/crd/gateway-api.yaml: go.mod
@curl -L https://github.com/kubernetes-sigs/gateway-api/releases/download/$(GATEWAY_API_VERSION)/standard-install.yaml -o internal/controller/testdata/crd/gateway-api.yaml
.PHONY: lint
lint:
@golangci-lint run ./...
File diff suppressed because it is too large Load Diff