From ad9cfe975492456d6c0e7f9a910225010e41a2c3 Mon Sep 17 00:00:00 2001 From: ADITYATIWARI342005 <142050150+ADITYATIWARI342005@users.noreply.github.com> Date: Fri, 7 Nov 2025 17:24:00 +0530 Subject: [PATCH 1/4] fix: update the .prettierignore and add the dependencies, remove,delete yamllint and requirements.txt update contributing.md Signed-off-by: ADITYATIWARI342005 <142050150+ADITYATIWARI342005@users.noreply.github.com> --- .prettierignore | 31 +++++++++ site/content/en/contributions/CONTRIBUTING.md | 2 + tools/github-actions/setup-deps/action.yaml | 4 ++ tools/go.mod | 1 + tools/linter/yamllint/.yamllint | 66 ------------------- tools/make/lint.mk | 29 ++++++-- tools/make/tools.mk | 1 - tools/src/yamllint/requirements.txt | 1 - 8 files changed, 60 insertions(+), 75 deletions(-) create mode 100644 .prettierignore delete mode 100644 tools/linter/yamllint/.yamllint delete mode 100644 tools/src/yamllint/requirements.txt diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000000..4b7f4ed6649 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,31 @@ +# Ignore templated/generated or external directories for YAML formatting +charts/gateway-helm/ +charts/gateway-addons-helm/ +charts/gateway-crds-helm/ + +# Generated install bundle +bin/install.yaml + +# Helm test charts +test/helm/gateway-helm/ +test/helm/gateway-addons-helm/ +test/helm/gateway-crds-helm/ + +# Example chart +examples/extension-server/charts/extension-server + +# Third-party / editor dirs +site/node_modules/ +.vscode/ + +# exclude release-notes +release-notes/* + +# testdata directories +**/testdata/** + +# GitHub workflows +.github/workflows/* + +# tools/github-actions +tools/github-actions/** diff --git a/site/content/en/contributions/CONTRIBUTING.md b/site/content/en/contributions/CONTRIBUTING.md index bdb9df9f3c9..9ae725a9e42 100644 --- a/site/content/en/contributions/CONTRIBUTING.md +++ b/site/content/en/contributions/CONTRIBUTING.md @@ -45,6 +45,8 @@ to the following guidelines for all code, APIs, and documentation: * Submit your PR. * Tests will automatically run for you. * We will **not** merge any PR that is not passing tests. +* Before submitting, ensure YAML is formatted: + * Run `make format-yaml` to auto-format all tracked YAML files using go-prettier. * PRs are expected to have 100% test coverage for added code. This can be verified with a coverage build. If your PR cannot have 100% coverage for some reason please clearly explain why, when you open it. diff --git a/tools/github-actions/setup-deps/action.yaml b/tools/github-actions/setup-deps/action.yaml index 2202ac9ac7c..22087f06e19 100644 --- a/tools/github-actions/setup-deps/action.yaml +++ b/tools/github-actions/setup-deps/action.yaml @@ -10,3 +10,7 @@ runs: with: go-version-file: go.mod cache: true + - shell: bash + run: | + go install github.com/wasilibs/go-prettier/v3/cmd/prettier@latest + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH diff --git a/tools/go.mod b/tools/go.mod index 914d83847c2..f6f15cf9309 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -9,6 +9,7 @@ tool ( github.com/google/go-jsonnet/cmd/jsonnet github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb github.com/norwoodj/helm-docs/cmd/helm-docs + github.com/wasilibs/go-prettier/v3/cmd/prettier golang.org/x/perf/cmd/benchstat google.golang.org/grpc/cmd/protoc-gen-go-grpc google.golang.org/protobuf/cmd/protoc-gen-go diff --git a/tools/linter/yamllint/.yamllint b/tools/linter/yamllint/.yamllint deleted file mode 100644 index ae2e0b76bd2..00000000000 --- a/tools/linter/yamllint/.yamllint +++ /dev/null @@ -1,66 +0,0 @@ ---- - -ignore: | - # This directory fails checks since many files - # are templated. Instead, we run the linter - # after running `make generate-manifests` which creates - # the Install YAML in bin/ - charts/gateway-helm/ - charts/gateway-addons-helm/ - charts/gateway-crds-helm/ - bin/install.yaml - test/helm/gateway-helm/ - test/helm/gateway-addons-helm/ - test/helm/gateway-crds-helm/ - examples/extension-server/charts/extension-server - site/node_modules/ - .vscode/ - -rules: - braces: - min-spaces-inside: 0 - max-spaces-inside: 0 - min-spaces-inside-empty: -1 - max-spaces-inside-empty: -1 - brackets: - min-spaces-inside: 0 - max-spaces-inside: 1 - min-spaces-inside-empty: -1 - max-spaces-inside-empty: -1 - colons: - max-spaces-before: 0 - max-spaces-after: 1 - commas: - max-spaces-before: 1 - min-spaces-after: 1 - max-spaces-after: 1 - comments: - level: error - require-starting-space: true - min-spaces-from-content: 2 - comments-indentation: - level: warning - document-end: disable - document-start: disable - empty-lines: - max: 2 - max-start: 0 - max-end: 1 - empty-values: - forbid-in-block-mappings: false - forbid-in-flow-mappings: true - hyphens: - max-spaces-after: 1 - indentation: - spaces: 2 - indent-sequences: consistent # be consistent: don't mix indentation styles in one file. - check-multi-line-strings: false - key-duplicates: enable - key-ordering: disable - new-line-at-end-of-file: enable - new-lines: - type: unix - trailing-spaces: enable - truthy: - check-keys: false # GitHub Actions uses "on:" as a key - level: warning diff --git a/tools/make/lint.mk b/tools/make/lint.mk index 43db54cc136..2be32ca8319 100644 --- a/tools/make/lint.mk +++ b/tools/make/lint.mk @@ -8,7 +8,27 @@ GITHUB_ACTION ?= LINT_BUILD_TAGS ?= e2e,celvalidation,conformance,experimental,benchmark,resilience,integration .PHONY: lint -lint: ## Run all linter of code sources, including golint, yamllint, whitenoise lint and codespell. +lint: ## Run all linter of code sources, including golint, whitenoise lint and codespell. + +# Format YAML files with go-prettier for consistent style. +.PHONY: format-yaml +format-yaml: ## Format YAML files with go-prettier + @$(LOG_TARGET) + @files="$$(git ls-files :*.yml :*.yaml)"; \ + if [ -n "$$files" ]; then \ + prettier -w $$files; \ + fi + +.PHONY: check-format-yaml +check-format-yaml: ## Check YAML formatting with go-prettier (no changes) + @$(LOG_TARGET) + @files="$$(git ls-files :*.yml :*.yaml)"; \ + if [ -n "$$files" ]; then \ + prettier --check $$files; \ + fi + +# Run YAML format check as part of gen-check to integrate with existing CI +gen-check: check-format-yaml # lint-deps is run separately in CI to separate the tooling install logs from the actual output logs generated # by the lint tooling. @@ -22,12 +42,7 @@ lint.golint: @$(LOG_TARGET) $(GO_TOOL) golangci-lint run $(GOLANGCI_LINT_FLAGS) --build-tags=$(LINT_BUILD_TAGS) --config=tools/linter/golangci-lint/.golangci.yml -.PHONY: lint.yamllint -lint: lint.yamllint -lint-deps: $(tools/yamllint) -lint.yamllint: $(tools/yamllint) - @$(LOG_TARGET) - $(tools/yamllint) --config-file=tools/linter/yamllint/.yamllint $$(git ls-files :*.yml :*.yaml | xargs -L1 dirname | sort -u) + CODESPELL_FLAGS ?= $(if $(GITHUB_ACTION),--disable-colors) .PHONY: lint.codespell diff --git a/tools/make/tools.mk b/tools/make/tools.mk index e1bb44c0212..3f225b55ee9 100644 --- a/tools/make/tools.mk +++ b/tools/make/tools.mk @@ -14,7 +14,6 @@ $(tools.bindir)/%: $(tools.srcdir)/%.sh # ========================= # tools/codespell = $(tools.bindir)/codespell -tools/yamllint = $(tools.bindir)/yamllint tools/sphinx-build = $(tools.bindir)/sphinx-build tools/release-notes-docs = $(tools.bindir)/release-notes-docs $(tools.bindir)/%.d/venv: $(tools.srcdir)/%/requirements.txt diff --git a/tools/src/yamllint/requirements.txt b/tools/src/yamllint/requirements.txt deleted file mode 100644 index 99c78bd3112..00000000000 --- a/tools/src/yamllint/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -yamllint==1.37.1 From 9d0219cb5be9a161f56a8cbfa5d6605bdca06728 Mon Sep 17 00:00:00 2001 From: ADITYATIWARI342005 <142050150+ADITYATIWARI342005@users.noreply.github.com> Date: Fri, 7 Nov 2025 17:51:22 +0530 Subject: [PATCH 2/4] remove the testdata files from .prettierignore Signed-off-by: ADITYATIWARI342005 <142050150+ADITYATIWARI342005@users.noreply.github.com> --- .prettierignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.prettierignore b/.prettierignore index 4b7f4ed6649..747be4ded0d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -21,9 +21,6 @@ site/node_modules/ # exclude release-notes release-notes/* -# testdata directories -**/testdata/** - # GitHub workflows .github/workflows/* From b54fa7ab5e206a7d6807e5aace27bf859babd626 Mon Sep 17 00:00:00 2001 From: ADITYATIWARI342005 <142050150+ADITYATIWARI342005@users.noreply.github.com> Date: Fri, 7 Nov 2025 18:51:19 +0530 Subject: [PATCH 3/4] fix: update .prettierignore for correct directories, remove unwanted block of setup from action.yaml, remove unwanted .phony blocks from lint.mk and install proper go dependency in tools.mk Signed-off-by: ADITYATIWARI342005 <142050150+ADITYATIWARI342005@users.noreply.github.com> --- .prettierignore | 8 ------ tools/github-actions/setup-deps/action.yaml | 4 --- tools/make/lint.mk | 28 ++++++++------------- tools/make/tools.mk | 13 ++++++++++ 4 files changed, 23 insertions(+), 30 deletions(-) diff --git a/.prettierignore b/.prettierignore index 747be4ded0d..196e5e7bd6f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,19 +2,11 @@ charts/gateway-helm/ charts/gateway-addons-helm/ charts/gateway-crds-helm/ - -# Generated install bundle bin/install.yaml - -# Helm test charts test/helm/gateway-helm/ test/helm/gateway-addons-helm/ test/helm/gateway-crds-helm/ - -# Example chart examples/extension-server/charts/extension-server - -# Third-party / editor dirs site/node_modules/ .vscode/ diff --git a/tools/github-actions/setup-deps/action.yaml b/tools/github-actions/setup-deps/action.yaml index 22087f06e19..2202ac9ac7c 100644 --- a/tools/github-actions/setup-deps/action.yaml +++ b/tools/github-actions/setup-deps/action.yaml @@ -10,7 +10,3 @@ runs: with: go-version-file: go.mod cache: true - - shell: bash - run: | - go install github.com/wasilibs/go-prettier/v3/cmd/prettier@latest - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH diff --git a/tools/make/lint.mk b/tools/make/lint.mk index 2be32ca8319..4099b80cdec 100644 --- a/tools/make/lint.mk +++ b/tools/make/lint.mk @@ -10,31 +10,26 @@ LINT_BUILD_TAGS ?= e2e,celvalidation,conformance,experimental,benchmark,resilien .PHONY: lint lint: ## Run all linter of code sources, including golint, whitenoise lint and codespell. +# lint-deps is run separately in CI to separate the tooling install logs from the actual output logs generated +# by the lint tooling. +.PHONY: lint-deps +lint-deps: $(tools/prettier) ## Everything necessary to lint + # Format YAML files with go-prettier for consistent style. -.PHONY: format-yaml -format-yaml: ## Format YAML files with go-prettier +format-yaml: $(tools/prettier) @$(LOG_TARGET) @files="$$(git ls-files :*.yml :*.yaml)"; \ if [ -n "$$files" ]; then \ - prettier -w $$files; \ + $(tools/prettier) -w $$files; \ fi -.PHONY: check-format-yaml -check-format-yaml: ## Check YAML formatting with go-prettier (no changes) +check-format-yaml: $(tools/prettier) @$(LOG_TARGET) @files="$$(git ls-files :*.yml :*.yaml)"; \ if [ -n "$$files" ]; then \ - prettier --check $$files; \ + $(tools/prettier) --check $$files; \ fi -# Run YAML format check as part of gen-check to integrate with existing CI -gen-check: check-format-yaml - -# lint-deps is run separately in CI to separate the tooling install logs from the actual output logs generated -# by the lint tooling. -.PHONY: lint-deps -lint-deps: ## Everything necessary to lint - GOLANGCI_LINT_FLAGS ?= .PHONY: lint.golint lint: lint.golint @@ -42,8 +37,6 @@ lint.golint: @$(LOG_TARGET) $(GO_TOOL) golangci-lint run $(GOLANGCI_LINT_FLAGS) --build-tags=$(LINT_BUILD_TAGS) --config=tools/linter/golangci-lint/.golangci.yml - - CODESPELL_FLAGS ?= $(if $(GITHUB_ACTION),--disable-colors) .PHONY: lint.codespell lint: lint.codespell @@ -75,7 +68,6 @@ lint.whitenoise: $(tools/whitenoise) @$(LOG_TARGET) $(tools/whitenoise) - .PHONY: lint.shellcheck lint: lint.shellcheck lint-deps: $(tools/shellcheck) @@ -92,7 +84,7 @@ lint.fix-golint: $(MAKE) lint.golint GOLANGCI_LINT_FLAGS="--fix" .PHONY: gen-check -gen-check: format generate manifests protos go.testdata.complete +gen-check: check-format-yaml format generate manifests protos go.testdata.complete @$(LOG_TARGET) @if [ ! -z "`git status --porcelain`" ]; then \ $(call errorlog, ERROR: Some files need to be updated, please run 'make generate', 'make manifests' and 'make protos' to include any changed files to your PR); \ diff --git a/tools/make/tools.mk b/tools/make/tools.mk index 3f225b55ee9..7afc61d3c3c 100644 --- a/tools/make/tools.mk +++ b/tools/make/tools.mk @@ -10,6 +10,19 @@ $(tools.bindir)/%: $(tools.srcdir)/%.sh mkdir -p $(@D) install $< $@ +# Go tools +# ======== +# IMPORTANT: Must come before pip section to avoid pattern rule conflicts +# +tools/buf = $(tools.bindir)/buf +tools/kind = $(tools.bindir)/kind +tools/prettier = $(tools.bindir)/prettier + +$(tools.bindir)/%: $(tools.srcdir)/go.mod $(tools.srcdir)/go.sum + @mkdir -p $(@D) + @echo "Installing Go tool: $*" + cd $(tools.srcdir) && GOBIN=$(CURDIR)/$(tools.bindir) go install $$(go list -m -f '{{.Path}}' all | grep '/$*$$' || go list -m -f '{{.Path}}/cmd/$*' all | grep '/cmd/$*$$') + # `pip install`-able things # ========================= # From 652403ce6632a7d940f707cc6d5deb5e7f5727a8 Mon Sep 17 00:00:00 2001 From: ADITYA TIWARI <142050150+ADITYATIWARI342005@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:26:43 +0000 Subject: [PATCH 4/4] format: yaml files Signed-off-by: ADITYA TIWARI <142050150+ADITYATIWARI342005@users.noreply.github.com> --- examples/admin-console-config.yaml | 34 ++--- examples/kubernetes/jwt/grpc-jwt.yaml | 22 +-- examples/kubernetes/jwt/jwt.yaml | 56 +++---- .../kubernetes/metric/stats-compression.yaml | 2 +- examples/standalone/quickstart.yaml | 2 +- .../manifests/httproute.yaml | 1 + .../translate/in/backend-endpoint.yaml | 2 +- .../translate/in/rejected-http-route.yaml | 1 - .../translate/out/invalid-envoyproxy.all.yaml | 10 +- .../testdata/decoder/in/gateway-ns-watch.yaml | 4 +- .../backend-invalid-hostname-address.in.yaml | 6 +- .../backend-invalid-hostname-address.out.yaml | 142 +++++++++--------- .../backend-with-localhost-host-infra.in.yaml | 4 +- ...backend-with-localhost-host-infra.out.yaml | 68 ++++----- 14 files changed, 178 insertions(+), 176 deletions(-) diff --git a/examples/admin-console-config.yaml b/examples/admin-console-config.yaml index 7fda3fc39b4..1ed6518fc0b 100644 --- a/examples/admin-console-config.yaml +++ b/examples/admin-console-config.yaml @@ -16,8 +16,8 @@ spec: watch: type: Namespaces namespaces: - - default - - app-namespace + - default + - app-namespace # Admin server configuration admin: @@ -54,11 +54,11 @@ spec: prometheus: disable: false sinks: - - type: OpenTelemetry - openTelemetry: - host: otel-collector.monitoring.svc.cluster.local - port: 4317 - protocol: grpc + - type: OpenTelemetry + openTelemetry: + host: otel-collector.monitoring.svc.cluster.local + port: 4317 + protocol: grpc --- # Example: Production configuration with console disabled @@ -77,8 +77,8 @@ spec: watch: type: Namespaces namespaces: - - production - - staging + - production + - staging # Production admin configuration - more restrictive admin: @@ -117,9 +117,9 @@ spec: watch: type: Namespaces namespaces: - - default - - development - - testing + - default + - development + - testing # Development admin configuration - all features enabled admin: @@ -148,8 +148,8 @@ spec: prometheus: disable: false sinks: - - type: OpenTelemetry - openTelemetry: - host: jaeger-collector.observability.svc.cluster.local - port: 4317 - protocol: grpc + - type: OpenTelemetry + openTelemetry: + host: jaeger-collector.observability.svc.cluster.local + port: 4317 + protocol: grpc diff --git a/examples/kubernetes/jwt/grpc-jwt.yaml b/examples/kubernetes/jwt/grpc-jwt.yaml index c841ddb7225..8c4aebd3bc5 100644 --- a/examples/kubernetes/jwt/grpc-jwt.yaml +++ b/examples/kubernetes/jwt/grpc-jwt.yaml @@ -9,9 +9,9 @@ spec: name: yages jwt: providers: - - name: example - remoteJWKS: - uri: https://raw.githubusercontent.com/envoyproxy/gateway/main/examples/kubernetes/jwt/jwks.json + - name: example + remoteJWKS: + uri: https://raw.githubusercontent.com/envoyproxy/gateway/main/examples/kubernetes/jwt/jwks.json --- apiVersion: gateway.networking.k8s.io/v1 kind: GRPCRoute @@ -21,13 +21,13 @@ metadata: example: grpc-routing spec: parentRefs: - - name: example-gateway + - name: example-gateway hostnames: - - "grpc-example.com" + - "grpc-example.com" rules: - - backendRefs: - - group: "" - kind: Service - name: yages - port: 9000 - weight: 1 + - backendRefs: + - group: "" + kind: Service + name: yages + port: 9000 + weight: 1 diff --git a/examples/kubernetes/jwt/jwt.yaml b/examples/kubernetes/jwt/jwt.yaml index a5ba7f4c100..591d0311e50 100644 --- a/examples/kubernetes/jwt/jwt.yaml +++ b/examples/kubernetes/jwt/jwt.yaml @@ -9,10 +9,10 @@ spec: name: foo jwt: providers: - - name: example - remoteJWKS: - uri: https://raw.githubusercontent.com/envoyproxy/gateway/main/examples/kubernetes/jwt/jwks.json - cacheDuration: 60s + - name: example + remoteJWKS: + uri: https://raw.githubusercontent.com/envoyproxy/gateway/main/examples/kubernetes/jwt/jwks.json + cacheDuration: 60s --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute @@ -20,20 +20,20 @@ metadata: name: foo spec: parentRefs: - - name: eg + - name: eg hostnames: - - "www.example.com" + - "www.example.com" rules: - - backendRefs: - - group: "" - kind: Service - name: backend - port: 3000 - weight: 1 - matches: - - path: - type: PathPrefix - value: /foo + - backendRefs: + - group: "" + kind: Service + name: backend + port: 3000 + weight: 1 + matches: + - path: + type: PathPrefix + value: /foo --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute @@ -41,17 +41,17 @@ metadata: name: bar spec: parentRefs: - - name: eg + - name: eg hostnames: - - "www.example.com" + - "www.example.com" rules: - - backendRefs: - - group: "" - kind: Service - name: backend - port: 3000 - weight: 1 - matches: - - path: - type: PathPrefix - value: /bar + - backendRefs: + - group: "" + kind: Service + name: backend + port: 3000 + weight: 1 + matches: + - path: + type: PathPrefix + value: /bar diff --git a/examples/kubernetes/metric/stats-compression.yaml b/examples/kubernetes/metric/stats-compression.yaml index e3a183665c3..4c650656090 100644 --- a/examples/kubernetes/metric/stats-compression.yaml +++ b/examples/kubernetes/metric/stats-compression.yaml @@ -20,4 +20,4 @@ spec: metrics: prometheus: compression: - type: Gzip ## Supported types are Gzip, Brotli, and Zstd + type: Gzip ## Supported types are Gzip, Brotli, and Zstd diff --git a/examples/standalone/quickstart.yaml b/examples/standalone/quickstart.yaml index 4ccf2ce8efd..e7a5cda07e5 100644 --- a/examples/standalone/quickstart.yaml +++ b/examples/standalone/quickstart.yaml @@ -42,5 +42,5 @@ metadata: spec: endpoints: - ip: - address: 0.0.0.0 # this address is for demo purpose only, do not use it in production! + address: 0.0.0.0 # this address is for demo purpose only, do not use it in production! port: 3000 diff --git a/examples/static-file-server/manifests/httproute.yaml b/examples/static-file-server/manifests/httproute.yaml index beaefdbb423..adb7fcabd03 100644 --- a/examples/static-file-server/manifests/httproute.yaml +++ b/examples/static-file-server/manifests/httproute.yaml @@ -20,3 +20,4 @@ spec: type: PathPrefix value: /wasm --- + diff --git a/internal/cmd/egctl/testdata/translate/in/backend-endpoint.yaml b/internal/cmd/egctl/testdata/translate/in/backend-endpoint.yaml index 867a1ec4440..a1b060ee97c 100644 --- a/internal/cmd/egctl/testdata/translate/in/backend-endpoint.yaml +++ b/internal/cmd/egctl/testdata/translate/in/backend-endpoint.yaml @@ -51,7 +51,7 @@ metadata: name: example-com-tls-policy spec: targetRefs: - - group: 'gateway.envoyproxy.io' + - group: "gateway.envoyproxy.io" kind: Backend name: backend validation: diff --git a/internal/cmd/egctl/testdata/translate/in/rejected-http-route.yaml b/internal/cmd/egctl/testdata/translate/in/rejected-http-route.yaml index 6979c77c15e..6a96acfad6d 100644 --- a/internal/cmd/egctl/testdata/translate/in/rejected-http-route.yaml +++ b/internal/cmd/egctl/testdata/translate/in/rejected-http-route.yaml @@ -34,4 +34,3 @@ spec: - path: type: PathPrefix value: / - diff --git a/internal/cmd/egctl/testdata/translate/out/invalid-envoyproxy.all.yaml b/internal/cmd/egctl/testdata/translate/out/invalid-envoyproxy.all.yaml index 0b837379b81..d3240abcb15 100644 --- a/internal/cmd/egctl/testdata/translate/out/invalid-envoyproxy.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/invalid-envoyproxy.all.yaml @@ -36,8 +36,8 @@ gatewayClass: namespace: default status: conditions: - - lastTransitionTime: null - message: 'Invalid parametersRef: dynamic_resources cannot be modified' - reason: InvalidParameters - status: "False" - type: Accepted + - lastTransitionTime: null + message: "Invalid parametersRef: dynamic_resources cannot be modified" + reason: InvalidParameters + status: "False" + type: Accepted diff --git a/internal/envoygateway/config/testdata/decoder/in/gateway-ns-watch.yaml b/internal/envoygateway/config/testdata/decoder/in/gateway-ns-watch.yaml index 44c995fc64d..25d305c962c 100644 --- a/internal/envoygateway/config/testdata/decoder/in/gateway-ns-watch.yaml +++ b/internal/envoygateway/config/testdata/decoder/in/gateway-ns-watch.yaml @@ -8,5 +8,5 @@ provider: watch: type: Namespaces namespaces: - - ns-a - - ns-b + - ns-a + - ns-b diff --git a/internal/gatewayapi/testdata/backend-invalid-hostname-address.in.yaml b/internal/gatewayapi/testdata/backend-invalid-hostname-address.in.yaml index 81aca19efd8..2a31ca639ac 100644 --- a/internal/gatewayapi/testdata/backend-invalid-hostname-address.in.yaml +++ b/internal/gatewayapi/testdata/backend-invalid-hostname-address.in.yaml @@ -7,7 +7,7 @@ backends: spec: endpoints: - fqdn: - hostname: '*.foo.com' + hostname: "*.foo.com" port: 3000 - apiVersion: gateway.envoyproxy.io/v1alpha1 kind: Backend @@ -17,7 +17,7 @@ backends: spec: endpoints: - fqdn: - hostname: 'localhost' + hostname: "localhost" port: 3000 - apiVersion: gateway.envoyproxy.io/v1alpha1 kind: Backend @@ -27,7 +27,7 @@ backends: spec: endpoints: - ip: - address: '127.0.0.3' + address: "127.0.0.3" port: 3000 - apiVersion: gateway.envoyproxy.io/v1alpha1 kind: Backend diff --git a/internal/gatewayapi/testdata/backend-invalid-hostname-address.out.yaml b/internal/gatewayapi/testdata/backend-invalid-hostname-address.out.yaml index 52d591a8423..56cc9c905a4 100644 --- a/internal/gatewayapi/testdata/backend-invalid-hostname-address.out.yaml +++ b/internal/gatewayapi/testdata/backend-invalid-hostname-address.out.yaml @@ -1,73 +1,75 @@ backends: -- apiVersion: gateway.envoyproxy.io/v1alpha1 - kind: Backend - metadata: - name: backend-fqdn - namespace: default - spec: - endpoints: - - fqdn: - hostname: '*.foo.com' - port: 3000 - status: - conditions: - - lastTransitionTime: null - message: 'The Backend was not accepted: hostname *.foo.com is not a valid FQDN' - reason: Accepted - status: "False" - type: Invalid -- apiVersion: gateway.envoyproxy.io/v1alpha1 - kind: Backend - metadata: - name: backend-fqdn - namespace: default - spec: - endpoints: - - fqdn: - hostname: localhost - port: 3000 - status: - conditions: - - lastTransitionTime: null - message: 'The Backend was not accepted: hostname localhost should be a domain - with at least two segments separated by dots' - reason: Accepted - status: "False" - type: Invalid -- apiVersion: gateway.envoyproxy.io/v1alpha1 - kind: Backend - metadata: - name: backend-fqdn - namespace: default - spec: - endpoints: - - ip: - address: 127.0.0.3 - port: 3000 - status: - conditions: - - lastTransitionTime: null - message: 'The Backend was not accepted: IP address 127.0.0.3 in the loopback - range is only supported when using the Host infrastructure' - reason: Accepted - status: "False" - type: Invalid -- apiVersion: gateway.envoyproxy.io/v1alpha1 - kind: Backend - metadata: - name: backend-ip - namespace: default - spec: - endpoints: - - ip: - address: example.com - port: 3001 - status: - conditions: - - lastTransitionTime: null - message: 'The Backend was not accepted: IP address example.com is invalid' - reason: Accepted - status: "False" - type: Invalid + - apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: Backend + metadata: + name: backend-fqdn + namespace: default + spec: + endpoints: + - fqdn: + hostname: "*.foo.com" + port: 3000 + status: + conditions: + - lastTransitionTime: null + message: "The Backend was not accepted: hostname *.foo.com is not a valid FQDN" + reason: Accepted + status: "False" + type: Invalid + - apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: Backend + metadata: + name: backend-fqdn + namespace: default + spec: + endpoints: + - fqdn: + hostname: localhost + port: 3000 + status: + conditions: + - lastTransitionTime: null + message: + "The Backend was not accepted: hostname localhost should be a domain + with at least two segments separated by dots" + reason: Accepted + status: "False" + type: Invalid + - apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: Backend + metadata: + name: backend-fqdn + namespace: default + spec: + endpoints: + - ip: + address: 127.0.0.3 + port: 3000 + status: + conditions: + - lastTransitionTime: null + message: + "The Backend was not accepted: IP address 127.0.0.3 in the loopback + range is only supported when using the Host infrastructure" + reason: Accepted + status: "False" + type: Invalid + - apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: Backend + metadata: + name: backend-ip + namespace: default + spec: + endpoints: + - ip: + address: example.com + port: 3001 + status: + conditions: + - lastTransitionTime: null + message: "The Backend was not accepted: IP address example.com is invalid" + reason: Accepted + status: "False" + type: Invalid infraIR: {} xdsIR: {} diff --git a/internal/gatewayapi/testdata/backend-with-localhost-host-infra.in.yaml b/internal/gatewayapi/testdata/backend-with-localhost-host-infra.in.yaml index ea3aaa1eb96..786925dfe49 100644 --- a/internal/gatewayapi/testdata/backend-with-localhost-host-infra.in.yaml +++ b/internal/gatewayapi/testdata/backend-with-localhost-host-infra.in.yaml @@ -7,7 +7,7 @@ backends: spec: endpoints: - fqdn: - hostname: 'localhost' + hostname: "localhost" port: 3000 - apiVersion: gateway.envoyproxy.io/v1alpha1 kind: Backend @@ -17,5 +17,5 @@ backends: spec: endpoints: - ip: - address: '127.0.0.3' + address: "127.0.0.3" port: 3000 diff --git a/internal/gatewayapi/testdata/backend-with-localhost-host-infra.out.yaml b/internal/gatewayapi/testdata/backend-with-localhost-host-infra.out.yaml index 0a14359f6c9..0f1820bc296 100644 --- a/internal/gatewayapi/testdata/backend-with-localhost-host-infra.out.yaml +++ b/internal/gatewayapi/testdata/backend-with-localhost-host-infra.out.yaml @@ -1,37 +1,37 @@ backends: -- apiVersion: gateway.envoyproxy.io/v1alpha1 - kind: Backend - metadata: - name: backend-fqdn - namespace: default - spec: - endpoints: - - fqdn: - hostname: localhost - port: 3000 - status: - conditions: - - lastTransitionTime: null - message: The Backend was accepted - reason: Accepted - status: "True" - type: Accepted -- apiVersion: gateway.envoyproxy.io/v1alpha1 - kind: Backend - metadata: - name: backend-fqdn - namespace: default - spec: - endpoints: - - ip: - address: 127.0.0.3 - port: 3000 - status: - conditions: - - lastTransitionTime: null - message: The Backend was accepted - reason: Accepted - status: "True" - type: Accepted + - apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: Backend + metadata: + name: backend-fqdn + namespace: default + spec: + endpoints: + - fqdn: + hostname: localhost + port: 3000 + status: + conditions: + - lastTransitionTime: null + message: The Backend was accepted + reason: Accepted + status: "True" + type: Accepted + - apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: Backend + metadata: + name: backend-fqdn + namespace: default + spec: + endpoints: + - ip: + address: 127.0.0.3 + port: 3000 + status: + conditions: + - lastTransitionTime: null + message: The Backend was accepted + reason: Accepted + status: "True" + type: Accepted infraIR: {} xdsIR: {}