Repository navigation
fix(gateway): support clusterIP and LoadBalancer nodePorts - #446
ruanweihong-aaa wants to merge 2 commits into
Conversation
Mirror apache/apisix-helm-chart#1074 for API7 gateway.
Cover all existing gateway listeners and stream nodePort settings.
Pre-merge checks:
|
| Check name | Status | Explanation |
|---|---|---|
| Security Check | PR #446 (author ruanweihong-aaa, base main, head fix/gateway-service-addressing) changes only Helm chart templating for the gateway Service. I diffed HEAD (a8306ec) against main (f… |
Full details: Security Check
-
Explanation
PR #446 (author ruanweihong-aaa, base main, head fix/gateway-service-addressing) changes only Helm chart templating for the gateway Service. I diffed HEAD (a8306ec) against main (f13b8ab). The changed files are charts/gateway/templates/service-gateway.yaml, charts/gateway/values.yaml, charts/gateway/Chart.yaml, charts/gateway/README.md, .github/scripts/check-gateway-service.py (a new render test), and .github/workflows/ci.yaml (one added CI step). The template adds an optional spec.clusterIP and extends the existing nodePort conditional from NodePort to NodePort or LoadBalancer. It also adds a fail when clusterIP is "None" on NodePort or LoadBalancer. The change does not touch application code, logging, serialization, credential handling, persistence, authorization, ownership checks, TLS verification, or secret references. Category review: 1. Sensitive data exposure in logs and responses: No issues found. The only new error text is a fixed string about clusterIP. 2. Secrets stored unencrypted: No issues found. No models, migrations, or persisted secrets are changed. 3. Authorization and permission bypass: No issues found. No handlers or permission checks are changed. 4. Cross-resource access and ownership: No issues found. No API resource lookups are changed. 5. TLS and cryptographic configuration: No issues found. No TLS or certificate settings are changed. 6. Resource isolation and shared resources: No issues found. No shared-resource or cascade logic is changed. 7. Secret reference resolution: No issues found. No $env:// or $secret:// fields are changed. Exposing LoadBalancer and NodePort ports is a networking behavior change. It is not one of the listed security categories, so it does not trigger a failure under this check.
Full details: E2e Test Quality Review
-
Explanation
Summary: The PR adds one new test file,
.github/scripts/check-gateway-service.py, and wires it into theHelm chartjob in.github/workflows/ci.yaml(line 67). The test is a unit-level render check. It is not an E2E test. This triggers the blocking E2E completeness criterion. Evidence: - The script definesGatewayServiceTest(unittest.TestCase). Itsrender()helper runshelm templateoncharts/gatewaywith--show-only templates/service-gateway.yamland parses the output YAML (lines 43–57). - Its four tests (test_cluster_ip,test_node_ports,test_stream_auto_assignment,test_headless_service) assert on the renderedspeconly (lines 59–97). None of them deploys the Service, sends traffic to a NodePort or LoadBalancer port, or reaches the gateway or etcd. The flow stops at the Helm template output. - The existing kind-basedct installjobs (ci.yaml lines 98–126) install the gateway chart. They do not exercise the newclusterIPor nodePort predicates. The PR does not modify those jobs, and no new E2E step covers the changed behavior. - No test-like files outside.github/scripts/check-gateway-service.pychanged in the PR diff (f13b8ab..a8306ectouches 6 files). The PR description cites "24 rendering cases", which matches render-only validation. Criterion results: 1. E2E completeness (Blocking): FAIL. The new tests are unit-level render tests. Per the check, unit tests alone are not sufficient. 2. Scenario coverage (Important): Major gaps. Covered:None, empty, IPv4, and IPv6clusterIPvalues; fixed versus auto nodePorts; headless-service error. Not covered: out-of-range or conflicting nodePort values, invalidclusterIPstrings, and any runtime failure or load case. 3. Readability (Minor): Test names are short and undocumented. Dense inline dict literals (lines 25–42) have no explanatory comments. 4. Test relationships: No shared state or ordering dependency found. Pass. 5. Assertion readability: Assertions are simpleassertEqualcalls. Pass. 6. Real services vs mocking: The test does not mock. It uses realhelmrendering. Pass. 7. Error handling:render()checksreturncodeand asserts stderr. Pass. 8. PR scope: The changes address the statedclusterIPand nodePort goal. No unrelated code found. Pass. 9. Concurrency: Not applicable. Pass. Note on the prior failure: The prior FAIL explanation is unavailable. This verdict rests on the current tree and diff, not on the prior run.Resolution
Add an E2E test for the gateway Service. Required changes: 1. Install the gateway chart into the kind cluster in CI. Set
gateway.typetoNodePortand toLoadBalancer, and setgateway.clusterIPand fixed nodePorts. Then assert the live Service spec withkubectl get svc -o json. 2. Send traffic to at least one fixed nodePort, or verify the connection path, to confirm the Service reaches the gateway. 3. Add scenario coverage for invalid or boundary inputs. Examples: an invalidclusterIPstring, a nodePort outside the valid range, and a port collision. 4. Add comments that state the purpose of each render case. Rename tests so each title states the scenario and the expected result.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Mirrors apache/apisix-helm-chart#1074 for the API7 gateway chart.
gateway.clusterIPfor ClusterIP, NodePort and LoadBalancer Services. Empty/null values retain Kubernetes allocation;Noneis limited to headless ClusterIP Services.Validation: 24 rendering cases pass on Helm 3.22.1 and 4.3.2; the default Service matches the base apart from its chart version label; gateway helm lint, flake8 7.3.0 --isolated, and git diff --check pass. All chart READMEs were regenerated with the Go-built helm-docs v1.13.1; only gateway documentation changes.