Skip to content

Commit 0340097

Browse files
oseoinpdabelf5
authored andcommitted
Shortcode for NIC version in docs (#5953)
1 parent da5b256 commit 0340097

40 files changed

+186
-169
lines changed

.github/scripts/release-version-update.sh

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ FILE_TO_UPDATE_HELM_CHART_VERSION=(
2929
)
3030

3131
usage() {
32-
echo "Usage: $0 <current_ic_version> <current_helm_chart_version> <new_ic_version> <new_helm_chart_version>"
32+
echo "Usage: $0 <current_ic_version> <current_helm_chart_version> <current_operator_version> <new_ic_version> <new_helm_chart_version> <new_operator_version>"
3333
exit 1
3434
}
3535

3636
current_ic_version=$1
3737
current_helm_chart_version=$2
38-
new_ic_version=$3
39-
new_helm_chart_version=$4
38+
current_operator_version=$3
39+
new_ic_version=$4
40+
new_helm_chart_version=$5
41+
new_operator_version=$6
4042

4143
if [ -z "${current_ic_version}" ]; then
4244
usage
@@ -46,6 +48,10 @@ if [ -z "${current_helm_chart_version}" ]; then
4648
usage
4749
fi
4850

51+
if [ -z "${current_operator_version}" ]; then
52+
usage
53+
fi
54+
4955
if [ -z "${new_ic_version}" ]; then
5056
usage
5157
fi
@@ -54,15 +60,23 @@ if [ -z "${new_helm_chart_version}" ]; then
5460
usage
5561
fi
5662

63+
if [ -z "${new_operator_version}" ]; then
64+
usage
65+
fi
66+
67+
5768
escaped_current_ic_version=$(printf '%s' "$current_ic_version" | sed -e 's/\./\\./g');
5869
escaped_current_helm_chart_version=$(printf '%s' "$current_helm_chart_version" | sed -e 's/\./\\./g');
70+
escaped_current_operator_version=$(printf '%s' "$current_operator_version" | sed -e 's/\./\\./g');
5971

6072
echo "Updating versions: "
6173
echo "ic_version: ${current_ic_version} -> ${new_ic_version}"
6274
echo "helm_chart_version: ${current_helm_chart_version} -> ${new_helm_chart_version}"
75+
echo "operator_version: ${current_operator_version} -> ${new_operator_version}"
6376

6477
regex_ic="s#$escaped_current_ic_version#$new_ic_version#g"
6578
regex_helm="s#$escaped_current_helm_chart_version#$new_helm_chart_version#g"
79+
regex_operator="s#$escaped_current_operator_version#$new_operator_version#g"
6680

6781
mv "${HELM_CHART_PATH}/values.schema.json" "${TMPDIR}/"
6882
jq --arg version "${new_ic_version}" \
@@ -107,20 +121,9 @@ for i in "${FILE_TO_UPDATE_HELM_CHART_VERSION[@]}"; do
107121
done
108122

109123
# update docs with new versions
110-
docs_files=$(find "${DOCS_TO_UPDATE_FOLDER}" -type f -name "*.md" ! -name releases.md ! -name CHANGELOG.md)
111-
for i in ${docs_files}; do
112-
if [ "${DEBUG}" != "false" ]; then
113-
echo "Processing ${i}"
114-
fi
115-
file_name=$(basename "${i}")
116-
mv "${i}" "${TMPDIR}/${file_name}"
117-
cat "${TMPDIR}/${file_name}" | sed -e "$regex_ic" | sed -e "$regex_helm" > "${i}"
118-
if [ $? -ne 0 ]; then
119-
echo "ERROR: failed processing ${i}"
120-
mv "${TMPDIR}/${file_name}" "${i}"
121-
exit 2
122-
fi
123-
done
124+
echo -n "${new_ic_version}" > ./docs/layouts/shortcodes/nic-version.html
125+
echo -n "${new_helm_chart_version}" > ./docs/layouts/shortcodes/nic-helm-version.html
126+
echo -n "${new_operator_version}" > ./docs/layouts/shortcodes/nic-operator-version.html
124127

125128
# update examples with new versions
126129
example_files=$(find "${EXAMPLES_PATH}" -type f -name "*.md")
@@ -130,7 +133,7 @@ for i in ${example_files}; do
130133
fi
131134
file_name=$(basename "${i}")
132135
mv "${i}" "${TMPDIR}/${file_name}"
133-
cat "${TMPDIR}/${file_name}" | sed -e "$regex_ic" | sed -e "$regex_helm" > "${i}"
136+
cat "${TMPDIR}/${file_name}" | sed -e "$regex_ic" | sed -e "$regex_helm" | sed -e "$regex_operator" > "${i}"
134137
if [ $? -ne 0 ]; then
135138
echo "ERROR: failed processing ${i}"
136139
mv "${TMPDIR}/${file_name}" "${i}"

.github/workflows/release-pr.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ on:
1919
description: "Helm version to release"
2020
required: true
2121
default: "1.1.3"
22+
current_operator_version:
23+
description: "Current operator version to replace"
24+
required: true
25+
default: "2.3.0"
26+
new_operator_version:
27+
description: "Operator version to release"
28+
required: true
29+
default: "2.3.1"
2230
k8s_versions:
2331
description: "Kubernetes versions this release has been tested on"
2432
required: true
@@ -56,7 +64,9 @@ jobs:
5664

5765
- name: Replace
5866
run: |
59-
.github/scripts/release-version-update.sh ${{ github.event.inputs.current_version }} ${{ github.event.inputs.current_helm_version }} ${{ github.event.inputs.new_version }} ${{ github.event.inputs.new_helm_version }}
67+
.github/scripts/release-version-update.sh \
68+
${{ github.event.inputs.current_version }} ${{ github.event.inputs.current_helm_version }} ${{ github.event.inputs.current_operator_version }} \
69+
${{ github.event.inputs.new_version }} ${{ github.event.inputs.new_helm_version }} ${{ github.event.inputs.new_operator_version }}
6070
.github/scripts/release-notes-update.sh ${{ github.event.inputs.new_version }} ${{ github.event.inputs.new_helm_version }} "${{ github.event.inputs.k8s_versions }}" "${{ github.event.inputs.release_date }}"
6171
6272
- name: Create Pull Request

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ repos:
88
- id: trailing-whitespace
99
exclude: '(\.md|\.snap)$'
1010
- id: end-of-file-fixer
11+
exclude: docs/layouts/shortcodes/nic-.*.html
1112
- id: check-yaml
1213
args: [--allow-multiple-documents]
1314
exclude: ^(charts/nginx-ingress/templates)

docs/content/configuration/configuration-examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ weight: 400
99

1010
Our [GitHub repo](https://github.com/nginxinc/kubernetes-ingress) includes a number of configuration examples:
1111

12-
- [*Examples of Custom Resources*](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/custom-resources) show how to advanced NGINX features by using VirtualServer, VirtualServerRoute, TransportServer and Policy Custom Resources.
13-
- [*Examples of Ingress Resources*](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/ingress-resources) show how to use advanced NGINX features in Ingress resources with annotations.
12+
- [*Examples of Custom Resources*](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/custom-resources) show how to advanced NGINX features by using VirtualServer, VirtualServerRoute, TransportServer and Policy Custom Resources.
13+
- [*Examples of Ingress Resources*](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/ingress-resources) show how to use advanced NGINX features in Ingress resources with annotations.

docs/content/configuration/global-configuration/configmap-resource.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ For more information, view the [VirtualServer and VirtualServerRoute resources](
9595
|*server-names-hash-max-size* | Sets the value of the [server_names_hash_max_size](https://nginx.org/en/docs/http/ngx_http_core_module.html#server_names_hash_max_size) directive. | *1024* | |
9696
|*map-hash-bucket-size* | Sets the value of the [map_hash_bucket_size](http://nginx.org/en/docs/http/ngx_http_map_module.html#map_hash_bucket_size) directive.| *256* | |
9797
|*map-hash-max-size* | Sets the value of the [map_hash_max_size](http://nginx.org/en/docs/http/ngx_http_map_module.html#map_hash_max_size) directive. | *2048* | |
98-
|*resolver-addresses* | Sets the value of the [resolver](https://nginx.org/en/docs/http/ngx_http_core_module.html#resolver) addresses. Note: If you use a DNS name (for example, *kube-dns.kube-system.svc.cluster.local* ) as a resolver address, NGINX Plus will resolve it using the system resolver during the start and on every configuration reload. If the name cannot be resolved or the DNS server doesn't respond, NGINX Plus will fail to start or reload. To avoid this, we recommend using IP addresses as resolver addresses instead of DNS names. Supported in NGINX Plus only. | N/A | [Support for Type ExternalName Services](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/ingress-resources/externalname-services). |
99-
|*resolver-ipv6* | Enables IPv6 resolution in the resolver. Supported in NGINX Plus only. | *True* | [Support for Type ExternalName Services](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/ingress-resources/externalname-services). |
100-
|*resolver-valid* | Sets the time NGINX caches the resolved DNS records. Supported in NGINX Plus only. | TTL value of a DNS record | [Support for Type ExternalName Services](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/ingress-resources/externalname-services). |
101-
|*resolver-timeout* | Sets the [resolver_timeout](https://nginx.org/en/docs/http/ngx_http_core_module.html#resolver_timeout) for name resolution. Supported in NGINX Plus only. | *30s* | [Support for Type ExternalName Services](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/ingress-resources/externalname-services). |
98+
|*resolver-addresses* | Sets the value of the [resolver](https://nginx.org/en/docs/http/ngx_http_core_module.html#resolver) addresses. Note: If you use a DNS name (for example, *kube-dns.kube-system.svc.cluster.local* ) as a resolver address, NGINX Plus will resolve it using the system resolver during the start and on every configuration reload. If the name cannot be resolved or the DNS server doesn't respond, NGINX Plus will fail to start or reload. To avoid this, we recommend using IP addresses as resolver addresses instead of DNS names. Supported in NGINX Plus only. | N/A | [Support for Type ExternalName Services](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/ingress-resources/externalname-services). |
99+
|*resolver-ipv6* | Enables IPv6 resolution in the resolver. Supported in NGINX Plus only. | *True* | [Support for Type ExternalName Services](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/ingress-resources/externalname-services). |
100+
|*resolver-valid* | Sets the time NGINX caches the resolved DNS records. Supported in NGINX Plus only. | TTL value of a DNS record | [Support for Type ExternalName Services](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/ingress-resources/externalname-services). |
101+
|*resolver-timeout* | Sets the [resolver_timeout](https://nginx.org/en/docs/http/ngx_http_core_module.html#resolver_timeout) for name resolution. Supported in NGINX Plus only. | *30s* | [Support for Type ExternalName Services](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/ingress-resources/externalname-services). |
102102
|*keepalive-timeout* | Sets the value of the [keepalive_timeout](https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout) directive. | *75s* | |
103103
|*keepalive-requests* | Sets the value of the [keepalive_requests](https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_requests) directive. | *1000* | |
104104
|*variables-hash-bucket-size* | Sets the value of the [variables_hash_bucket_size](https://nginx.org/en/docs/http/ngx_http_core_module.html#variables_hash_bucket_size) directive. | *256* | |
@@ -115,9 +115,9 @@ For more information, view the [VirtualServer and VirtualServerRoute resources](
115115
|*error-log-level* | Sets the global [error log level](https://nginx.org/en/docs/ngx_core_module.html#error_log) for NGINX. | *notice* | |
116116
|*access-log-off* | Disables the [access log](https://nginx.org/en/docs/http/ngx_http_log_module.html#access_log). | *False* | |
117117
|*default-server-access-log-off* | Disables the [access log](https://nginx.org/en/docs/http/ngx_http_log_module.html#access_log) for the default server. If access log is disabled globally (*access-log-off: "True"*), then the default server access log is always disabled. | *False* | |
118-
|*log-format* | Sets the custom [log format](https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format) for HTTP and HTTPS traffic. For convenience, it is possible to define the log format across multiple lines (each line separated by *\n*). In that case, the Ingress Controller will replace every *\n* character with a space character. All *'* characters must be escaped. | See the [template file](https://github.com/nginxinc/kubernetes-ingress/blob/v3.6.1/internal/configs/version1/nginx.tmpl) for the access log. | [Custom Log Format](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/shared-examples/custom-log-format). |
118+
|*log-format* | Sets the custom [log format](https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format) for HTTP and HTTPS traffic. For convenience, it is possible to define the log format across multiple lines (each line separated by *\n*). In that case, the Ingress Controller will replace every *\n* character with a space character. All *'* characters must be escaped. | See the [template file](https://github.com/nginxinc/kubernetes-ingress/blob/v{{< nic-version >}}/internal/configs/version1/nginx.tmpl) for the access log. | [Custom Log Format](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/shared-examples/custom-log-format). |
119119
|*log-format-escaping* | Sets the characters escaping for the variables of the log format. Supported values: *json* (JSON escaping), *default* (the default escaping) *none* (disables escaping). | *default* | |
120-
|*stream-log-format* | Sets the custom [log format](https://nginx.org/en/docs/stream/ngx_stream_log_module.html#log_format) for TCP, UDP, and TLS Passthrough traffic. For convenience, it is possible to define the log format across multiple lines (each line separated by *\n*). In that case, the Ingress Controller will replace every *\n* character with a space character. All *'* characters must be escaped. | See the [template file](https://github.com/nginxinc/kubernetes-ingress/blob/v3.6.1/internal/configs/version1/nginx.tmpl). | |
120+
|*stream-log-format* | Sets the custom [log format](https://nginx.org/en/docs/stream/ngx_stream_log_module.html#log_format) for TCP, UDP, and TLS Passthrough traffic. For convenience, it is possible to define the log format across multiple lines (each line separated by *\n*). In that case, the Ingress Controller will replace every *\n* character with a space character. All *'* characters must be escaped. | See the [template file](https://github.com/nginxinc/kubernetes-ingress/blob/v{{< nic-version >}}/internal/configs/version1/nginx.tmpl). | |
121121
|*stream-log-format-escaping* | Sets the characters escaping for the variables of the stream log format. Supported values: *json* (JSON escaping), *default* (the default escaping) *none* (disables escaping). | *default* | |
122122
{{</bootstrap-table>}}
123123
@@ -159,7 +159,7 @@ For more information, view the [VirtualServer and VirtualServerRoute resources](
159159
|ConfigMap Key | Description | Default | Example |
160160
| ---| ---| ---| --- |
161161
|*http2* | Enables HTTP/2 in servers with SSL enabled. | *False* | |
162-
|*proxy-protocol* | Enables PROXY Protocol for incoming connections. | *False* | [Proxy Protocol](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/shared-examples/proxy-protocol). |
162+
|*proxy-protocol* | Enables PROXY Protocol for incoming connections. | *False* | [Proxy Protocol](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/shared-examples/proxy-protocol). |
163163
{{</bootstrap-table>}}
164164
165165
---
@@ -187,7 +187,7 @@ For more information, view the [VirtualServer and VirtualServerRoute resources](
187187
|*http-snippets* | Sets a custom snippet in http context. | N/A | |
188188
|*location-snippets* | Sets a custom snippet in location context. | N/A | |
189189
|*server-snippets* | Sets a custom snippet in server context. | N/A | |
190-
|*stream-snippets* | Sets a custom snippet in stream context. | N/A | [Support for TCP/UDP Load Balancing](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/ingress-resources/tcp-udp). |
190+
|*stream-snippets* | Sets a custom snippet in stream context. | N/A | [Support for TCP/UDP Load Balancing](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/ingress-resources/tcp-udp). |
191191
|*main-template* | Sets the main NGINX configuration template. | By default the template is read from the file in the container. | [Custom Templates](/nginx-ingress-controller/configuration/global-configuration/custom-templates). |
192192
|*ingress-template* | Sets the NGINX configuration template for an Ingress resource. | By default the template is read from the file on the container. | [Custom Templates](/nginx-ingress-controller/configuration/global-configuration/custom-templates). |
193193
|*virtualserver-template* | Sets the NGINX configuration template for an VirtualServer resource. | By default the template is read from the file on the container. | [Custom Templates](/nginx-ingress-controller/configuration/global-configuration/custom-templates). |

docs/content/configuration/global-configuration/custom-templates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ weight: 500
88
---
99

1010

11-
F5 NGINX Ingress Controller uses templates to generate NGINX configuration for Ingress resources, VirtualServer resources and the main NGINX configuration file. You can customize the templates and apply them via the ConfigMap. See the [corresponding example](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/shared-examples/custom-templates).
11+
F5 NGINX Ingress Controller uses templates to generate NGINX configuration for Ingress resources, VirtualServer resources and the main NGINX configuration file. You can customize the templates and apply them via the ConfigMap. See the [corresponding example](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/shared-examples/custom-templates).

docs/content/configuration/host-and-listener-collisions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ It is possible to merge configuration for multiple Ingress resources for the sam
102102

103103
The [Cross-namespace configuration]({{< relref "configuration/ingress-resources/cross-namespace-configuration.md">}}) topic has more information.
104104

105-
It is *not* possible to merge the configurations for multiple VirtualServer resources for the same host. However, you can split the VirtualServers into multiple VirtualServerRoute resources, which a single VirtualServer can then reference. See the [corresponding example](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/custom-resources/cross-namespace-configuration) on GitHub.
105+
It is *not* possible to merge the configurations for multiple VirtualServer resources for the same host. However, you can split the VirtualServers into multiple VirtualServerRoute resources, which a single VirtualServer can then reference. See the [corresponding example](https://github.com/nginxinc/kubernetes-ingress/tree/v{{< nic-version >}}/examples/custom-resources/cross-namespace-configuration) on GitHub.
106106

107107
It is *not* possible to merge configuration for multiple TransportServer resources.
108108

0 commit comments

Comments
 (0)