diff --git a/CHANGELOG/0.x-CHANGELOG.md b/CHANGELOG/0.x-CHANGELOG.md index c6bbf4db3c..20f76c6551 100644 --- a/CHANGELOG/0.x-CHANGELOG.md +++ b/CHANGELOG/0.x-CHANGELOG.md @@ -1538,7 +1538,7 @@ The following changes have been made since v0.3.0: GEP added in [#749](https://github.com/kubernetes-sigs/gateway-api/pull/749). Implemented in [#768](https://github.com/kubernetes-sigs/gateway-api/pull/768). - [GEP-851](https://github.com/kubernetes-sigs/gateway-api/blob/main/geps/gep-851.md) + [GEP-851](https://gateway-api.sigs.k8s.io/geps/gep-820/) was a follow up on this change that allowed multiple Certificate Refs per Gateway Listener. This was implemented in [#852](https://github.com/kubernetes-sigs/gateway-api/pull/852). @@ -1553,7 +1553,7 @@ The following changes have been made since v0.3.0: ### Small Changes * Extension points within match blocks from all Routes have been removed [#829](https://github.com/kubernetes-sigs/gateway-api/pull/829). Implements - [GEP-820](https://github.com/kubernetes-sigs/gateway-api/blob/main/geps/gep-820.md). + [GEP-820](https://gateway-api.sigs.k8s.io/geps/gep-820/). These extension points have been removed because they are currently not used, are poorly understood, and we don't have good use cases for them. We may consider re-adding them in the future. @@ -1700,11 +1700,11 @@ The following changes have been made since v0.4.0-rc1: ### GEP implementations * Replace `CertificateRef` field with `CertificateRefs` in `GatewayTLSConfig`. [#852](https://github.com/kubernetes-sigs/gateway-api/pull/852). This implements -[GEP-851](https://github.com/kubernetes-sigs/gateway-api/blob/main/geps/gep-851.md), +[GEP-851](https://gateway-api.sigs.k8s.io/geps/gep-851/), Allow Multiple Certificate Refs per Gateway Listener. * Extension points within match blocks from all Routes have been removed [#829](https://github.com/kubernetes-sigs/gateway-api/pull/829). Implements -[GEP-820](https://github.com/kubernetes-sigs/gateway-api/blob/main/geps/gep-820.md). +[GEP-820](https://gateway-api.sigs.k8s.io/geps/gep-820/). These extension points have been removed because they are currently not used, are poorly understood, and we don't have good use cases for them. We may consider re-adding them in the future. diff --git a/go.mod b/go.mod index cfc7fd9e55..7e5208139d 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( golang.org/x/sync v0.10.0 google.golang.org/grpc v1.69.2 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 - google.golang.org/protobuf v1.36.0 + google.golang.org/protobuf v1.36.1 k8s.io/api v0.31.3 k8s.io/apiextensions-apiserver v0.31.3 k8s.io/apimachinery v0.31.3 diff --git a/go.sum b/go.sum index 417fe894af..79c8e6bb5d 100644 --- a/go.sum +++ b/go.sum @@ -196,8 +196,8 @@ google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA= -google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= -google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= +google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/hack/verify-markdown-link.sh b/hack/verify-markdown-link.sh new file mode 100755 index 0000000000..d33ae246b3 --- /dev/null +++ b/hack/verify-markdown-link.sh @@ -0,0 +1,110 @@ +#!/bin/bash + +# Copyright 2014 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +log_error() { + echo "ERROR: $*" 1>&2 +} + +log_info() { + echo "INFO: $*" 1>&2 +} + +extract_external_links() { + local file_path="$1" + local -n links_array=$2 # Use nameref to pass array by reference + + # Check if the file exists and is readable + if [[ -f "$file_path" && -r "$file_path" ]]; then + # Read the content of the file + local content=$(<"$file_path") + # Use grep with a refined regex pattern to extract links + while IFS= read -r link; do + # Trim trailing characters like ']', ')' or '"' + link=$(echo "$link" | sed -E 's/[]")\]]+$//') + links_array+=("$link") + done < <(echo "$content" | grep -oP 'https?://[^\s")\]]+') + else + log_error "File does not exist or is not readable: $file_path" + return 1 + fi +} + + +validate_url() { + local url="$1" + local http_status=$(curl -o /dev/null -s -w "%{http_code}\n" "$url") + local excluded_domains=("foo.ns.service.cluster.local") + excluded_domains+=("redirect.example") + excluded_domains+=("rewrite.example") + excluded_domains+=("elsewhere.example") + # Check if the URL contains any of the excluded domains + for excluded_domain in "${excluded_domains[@]}"; do + if [[ "$url" == *"$excluded_domain"* ]]; then + log_info "Skipping excluded URL: $url" + return 0 + fi + done + + # Check if the status code indicates success (200-399) + if [[ "$http_status" -ge 200 && "$http_status" -lt 400 || "$http_status" == "000" ]]; then + log_info "Success: $url returned status code $http_status" + return 0 + else + log_error "Error: $url returned status code $http_status" + return 1 + fi +} + +# Check for broken links in markdown files within a specified directory +check_broken_links_in_directory() { + local directory=$1 + local exit_code=0 + + # Find all .md files in the specified directory and its subdirectories + for markdown_file in $(find "$directory" -type f -name "*.md"); do + log_info "Checking $markdown_file for broken links" + + declare -a links + extract_external_links "$markdown_file" links + + for link in "${links[@]}"; do + validate_url "$link" + result=$? + if [[ $result -eq 1 ]]; then + exit_code=1 + fi + done + done + + return $exit_code +} + +ROOT_DIR=$(dirname "${BASH_SOURCE[0]}")/.. + +if [[ ! -d "$ROOT_DIR" ]]; then + log_error "The specified directory $ROOT_DIR does not exist" + exit 1 +fi + +# Check for broken links in markdown files +check_broken_links_in_directory "$ROOT_DIR" +exit_code=$? + +exit $exit_code diff --git a/requirements.txt b/requirements.txt index 372c0fdc0e..440909d7a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ mkdocs-redirects==1.2.2 mkdocs-mermaid2-plugin==1.2.1 pandas>=2.0.3 pep562==1.1 -Pygments==2.18.0 +Pygments==2.19.0 pymdown-extensions==10.12 PyYAML==6.0.2 six==1.17.0 diff --git a/site-src/implementations.md b/site-src/implementations.md index bbb0bb0102..3986ab8012 100644 --- a/site-src/implementations.md +++ b/site-src/implementations.md @@ -463,10 +463,10 @@ If you have any suggestions or experience issues with NGINX Gateway Fabric, plea You can read our [docs][ngrok-k8s-gwapi-docs] for more information. If you have any feature requests or bug reports, please [create an issue][ngrok-issue-new]. You can also reach out for help on [Slack][ngrok-slack] -[ngrok-k8s-operator]:https://github.com/ngrok/kubernetes-ingress-controller +[ngrok-k8s-operator]:https://github.com/ngrok/ngrok-operator [ngrok]:https://ngrok.com [ngrok-k8s-gwapi-docs]:https://ngrok.com/docs/k8s/ -[ngrok-issue-new]: https://github.com/ngrok/kubernetes-ingress-controller/issues/new +[ngrok-issue-new]: https://github.com/ngrok/ngrok-operator/issues/new/choose [ngrok-slack]:https://ngrokcommunity.slack.com/channels/general ### STUNner