Skip to content

Commit 2ccea14

Browse files
committed
cleanup makefile and servers.go
1 parent ddb3ae3 commit 2ccea14

File tree

7 files changed

+9
-146
lines changed

7 files changed

+9
-146
lines changed

examples/cafe-example/eppinvalidservice.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.

examples/cafe-example/eppunavailablefailopen.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

examples/cafe-example/inferencepool-resolvedrefs.yaml

Lines changed: 0 additions & 54 deletions
This file was deleted.

internal/controller/nginx/config/servers_template.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,6 @@ server {
124124
{{- end }}
125125
126126
{{- if contains $l.Type "inference" -}}
127-
if ($request_method = GET) {
128-
set $inference_workload_endpoint "";
129-
rewrite ^ {{ $l.EPPInternalPath }} last;
130-
}
131-
132127
js_var $inference_workload_endpoint;
133128
set $epp_internal_path {{ $l.EPPInternalPath }};
134129
set $epp_host {{ $l.EPPHost }};

internal/controller/nginx/config/servers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,7 +2525,7 @@ func TestCreateLocations_InferenceBackends(t *testing.T) {
25252525
Path: "= /inference",
25262526
Type: http.InferenceExternalLocationType,
25272527
EPPInternalPath: "/_ngf-internal-rule0-route0-inference",
2528-
EPPHost: "test-epp.test.svc.cluster.local",
2528+
EPPHost: "test-epp.test",
25292529
EPPPort: 80,
25302530
},
25312531
createDefaultRootLocation(),
@@ -2545,7 +2545,7 @@ func TestCreateLocations_InferenceBackends(t *testing.T) {
25452545
Path: "/_ngf-internal-rule0-route0-inference",
25462546
Type: http.InferenceInternalLocationType,
25472547
EPPInternalPath: "/_ngf-internal-rule0-route0",
2548-
EPPHost: "test-epp.test.svc.cluster.local",
2548+
EPPHost: "test-epp.test",
25492549
EPPPort: 80,
25502550
},
25512551
{

tests/Makefile

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CI ?= false
22
CLUSTER_NAME ?= kind
33
CONFORMANCE_PREFIX = conformance-test-runner## Prefix for the conformance test runner image
4-
CONFORMANCE_INFERENCE_PREFIX = conformance-inference-test-runner## Prefix for the conformance test runner image
54
CONFORMANCE_TAG = latest## Tag for the conformance test runner image
65
GATEWAY_CLASS = nginx## Gateway class to use
76
GINKGO_FLAGS =
@@ -47,10 +46,6 @@ update-go-modules: ## Update the gateway-api go modules to latest main version
4746
build-test-runner-image: ## Build conformance test runner image
4847
docker build --platform $(GOOS)/$(GOARCH) -t $(CONFORMANCE_PREFIX):$(CONFORMANCE_TAG) -f conformance/Dockerfile .
4948

50-
.PHONY: build-test-runner-image-for-inference
51-
build-test-runner-image-for-inference: ## Build conformance test runner image for inference extension
52-
docker build --platform $(GOOS)/$(GOARCH) -t $(CONFORMANCE_INFERENCE_PREFIX):$(CONFORMANCE_TAG) -f conformance/Dockerfile .
53-
5449
.PHONY: build-crossplane-image
5550
build-crossplane-image: ## Build the crossplane image
5651
docker build --platform $(GOOS)/$(GOARCH) --build-arg NGINX_CONF_DIR=$(NGINX_CONF_DIR) -t nginx-crossplane:latest -f framework/crossplane/Dockerfile ..
@@ -65,7 +60,7 @@ run-conformance-tests: ## Run conformance tests
6560
--restart=Never -- sh -c "go test -v . -tags conformance,experimental -args --gateway-class=$(GATEWAY_CLASS) \
6661
--supported-features=$(SUPPORTED_EXTENDED_FEATURES) --version=$(NGF_VERSION) --skip-tests=$(SKIP_TESTS) --conformance-profiles=$(CONFORMANCE_PROFILES) \
6762
--report-output=output.txt; cat output.txt" | tee output.txt
68-
./scripts/check-pod-exit-code.sh conformance
63+
./scripts/check-pod-exit-code.sh
6964
sed -e '1,/CONFORMANCE PROFILE/d' output.txt > conformance-profile.yaml
7065
grpc_core_result=`yq '.profiles[0].core.result' conformance-profile.yaml`; \
7166
http_core_result=`yq '.profiles[1].core.result' conformance-profile.yaml`; \
@@ -85,7 +80,7 @@ run-conformance-tests-openshift: ## Run conformance tests on OpenShift (skips te
8580
--restart=Never -- sh -c "go test -v . -tags conformance,experimental -args --gateway-class=$(GATEWAY_CLASS) \
8681
--supported-features=$(SUPPORTED_EXTENDED_FEATURES_OPENSHIFT) --version=$(NGF_VERSION) --skip-tests=$(SKIP_TESTS_OPENSHIFT) --conformance-profiles=$(CONFORMANCE_PROFILES) \
8782
--service-type=$(GW_SERVICE_TYPE) --report-output=output.txt; cat output.txt" | tee output.txt
88-
./scripts/check-pod-exit-code.sh conformance
83+
./scripts/check-pod-exit-code.sh
8984
sed -e '1,/CONFORMANCE PROFILE/d' output.txt > conformance-profile.yaml
9085
rm output.txt
9186
grpc_core_result=`yq '.profiles[0].core.result' conformance-profile.yaml`; \
@@ -99,17 +94,17 @@ run-conformance-tests-openshift: ## Run conformance tests on OpenShift (skips te
9994

10095
.PHONY: run-inference-conformance-tests
10196
run-inference-conformance-tests: ## Run inference conformance tests
102-
kind load docker-image $(CONFORMANCE_INFERENCE_PREFIX):$(CONFORMANCE_TAG) --name $(CLUSTER_NAME)
97+
kind load docker-image $(CONFORMANCE_PREFIX):$(CONFORMANCE_TAG) --name $(CLUSTER_NAME)
10398
kubectl apply -f conformance/conformance-rbac.yaml
104-
kubectl run -i conformance-inference \
105-
--image=$(CONFORMANCE_INFERENCE_PREFIX):$(CONFORMANCE_TAG) --image-pull-policy=Never \
99+
kubectl run -i conformance \
100+
--image=$(CONFORMANCE_PREFIX):$(CONFORMANCE_TAG) --image-pull-policy=Never \
106101
--overrides='{ "spec": { "serviceAccountName": "conformance" } }' \
107102
--restart=Never -- sh -c "go test -v . -tags conformance -args --gateway-class=$(GATEWAY_CLASS) \
108103
--version=$(NGF_VERSION) \
109104
--skip-tests=$(INFERENCE_SKIP_TESTS) \
110105
--supported-features=$(INFERENCE_SUPPORTED_FEATURES) \
111106
--report-output=output.txt; cat output.txt" | tee output.txt
112-
./scripts/check-pod-exit-code.sh conformance-inference
107+
./scripts/check-pod-exit-code.sh
113108
sed -e '1,/GatewayAPIInferenceExtensionVersion/d' output.txt > conformance-profile-inference.yaml
114109
rm output.txt
115110
core_result=`yq '.profiles[0].core.result' conformance-profile-inference.yaml`; \
@@ -122,12 +117,6 @@ run-inference-conformance-tests: ## Run inference conformance tests
122117
.PHONY: cleanup-conformance-tests
123118
cleanup-conformance-tests: ## Clean up conformance tests fixtures
124119
kubectl delete pod conformance
125-
kubectl delete pod conformance-inference
126-
kubectl delete -f conformance/conformance-rbac.yaml
127-
128-
.PHONY: cleanup-conformance-inference-tests
129-
cleanup-conformance-inference-tests: ## Clean up conformance inference tests fixtures
130-
kubectl delete pod conformance-inference
131120
kubectl delete -f conformance/conformance-rbac.yaml
132121

133122
.PHONY: reset-go-modules

tests/scripts/check-pod-exit-code.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@
22

33
set -eo pipefail
44

5-
# Check if a pod name is provided as an argument
6-
if [ "$#" -ne 1 ]; then
7-
echo "Provide pod name: $0"
8-
exit 1
9-
fi
10-
11-
POD_NAME=$1
12-
13-
# Get the exit code of the specified pod
14-
CODE=$(kubectl get pod "${POD_NAME}" -o jsonpath='{.status.containerStatuses[].state.terminated.exitCode}')
5+
CODE=$(kubectl get pod conformance -o jsonpath='{.status.containerStatuses[].state.terminated.exitCode}')
156
if [ "${CODE}" -ne 0 ]; then
167
exit 2
178
fi

0 commit comments

Comments
 (0)