Skip to content

Commit 365fee4

Browse files
committed
fix: use kustomize build with --load-restrictor for deploy
Kustomize 5.x enforces LoadRestrictionsRootOnly by default, which blocks configMapGenerator references to files outside the kustomization root (base references ../../../configs/). Use kustomize standalone with --load-restrictor LoadRestrictionsNone instead of kubectl apply -k. Affected: - .github/workflows/e2e.yml: install kustomize, use kustomize build - Makefile: conformance target - test/e2e/smoke/run.sh: deploy_gateway
1 parent 15adade commit 365fee4

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@ jobs:
4242
kind load docker-image "ghcr.io/nantian-gw/${img}:latest" --name e2e
4343
done
4444
45+
- name: Install kustomize
46+
run: |
47+
curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.7.1/kustomize_v5.7.1_linux_amd64.tar.gz" | tar xz
48+
sudo mv kustomize /usr/local/bin/
49+
4550
- name: Deploy nantian-gw
4651
run: |
47-
kubectl apply -k deploy/kubernetes/overlays/kind-conformance
52+
kustomize build deploy/kubernetes/overlays/kind-conformance --load-restrictor LoadRestrictionsNone | kubectl apply -f -
4853
kubectl wait --for=condition=ready pod --all -n nantian-gw --timeout=300s
4954
5055
- name: Record image versions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ conformance:
1919
@echo "=== Installing Gateway API CRDs ==="
2020
kubectl apply -f $(GATEWAY_API_CRDS)
2121
@echo "=== Deploying nantian-gw ==="
22-
kubectl apply -k deploy/kubernetes/overlays/kind-conformance
22+
kustomize build deploy/kubernetes/overlays/kind-conformance --load-restrictor LoadRestrictionsNone | kubectl apply -f -
2323
kubectl wait --for=condition=ready pod --all -n nantian-gw --timeout=180s
2424
@echo "=== Running conformance tests ==="
2525
go test -tags=conformance -count=1 -v -timeout 30m ./conformance/

test/e2e/smoke/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ deploy_gateway() {
6262
return
6363
fi
6464
echo "=== Deploying nantian-gw ==="
65-
kubectl apply -k "$GATEWAY_ROOT/deploy/kubernetes/overlays/kind-conformance"
65+
kustomize build "$GATEWAY_ROOT/deploy/kubernetes/overlays/kind-conformance" --load-restrictor LoadRestrictionsNone | kubectl apply -f -
6666
kubectl wait --for=condition=ready pod --all -n "$CONTROL_PLANE_NS" --timeout="${TIMEOUT}s"
6767
}
6868

0 commit comments

Comments
 (0)