8000 Cherry pick 3.4.1 (#4886) · nginx/kubernetes-ingress@a376068 · GitHub
[go: up one dir, main page]

Skip to content

Commit a376068

Browse files
pdabelf5haywoodshlucacomeoseoinvepatel
authored
Cherry pick 3.4.1 (#4886)
* fix release script for helm (#4810) Signed-off-by: Haywood Shannon <5781935+haywoodsh@users.noreply.github.com> * Test jobs further refactor (#4820) * Fix AWS registry (#4825) * Don't push Marketplace images (#4827) * Add the ability to have Nginx version checks in templates (#4831) Add the ability to add version dependent template elements * Add trigger for GCP Marketplace repo (#4829) * Add automatic push to GCP Marketplace (#4828) * Update N+ to R31 (#4850) * Bump the go group with 3 updates (#4846) Bumps the go group with 3 updates: [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2), [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) and [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang). Updates `github.com/aws/aws-sdk-go-v2/config` from 1.26.1 to 1.26.2 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](aws/aws-sdk-go-v2@config/v1.26.1...config/v1.26.2) Updates `github.com/go-chi/chi/v5` from 5.0.10 to 5.0.11 - [Release notes](https://github.com/go-chi/chi/releases) - [Changelog](https://github.com/go-chi/chi/blob/master/CHANGELOG.md) - [Commits](go-chi/chi@v5.0.10...v5.0.11) Updates `github.com/prometheus/client_golang` from 1.17.0 to 1.18.0 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.17.0...v1.18.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go - dependency-name: github.com/go-chi/chi/v5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Report User Agent for Alpine and UBI (#4845) * Bump the go group with 2 updates (#4873) Bumps the go group with 2 updates: [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) and [github.com/aws/aws-sdk-go-v2/service/marketplacemetering](https://github.com/aws/aws-sdk-go-v2). Updates `github.com/aws/aws-sdk-go-v2/config` from 1.26.2 to 1.26.3 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](aws/aws-sdk-go-v2@config/v1.26.2...config/v1.26.3) Updates `github.com/aws/aws-sdk-go-v2/service/marketplacemetering` from 1.19.5 to 1.19.6 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](aws/aws-sdk-go-v2@service/mq/v1.19.5...service/efs/v1.19.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go - dependency-name: github.com/aws/aws-sdk-go-v2/service/marketplacemetering dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Paul Abel <128620221+pdabelf5@users.noreply.github.com> * Update UBI string for new images (#4893) * Bump the go group with 1 update (#4905) Bumps the go group with 1 update: [github.com/nginxinc/nginx-prometheus-exporter](https://github.com/nginxinc/nginx-prometheus-exporter). Updates `github.com/nginxinc/nginx-prometheus-exporter` from 1.0.0 to 1.1.0 - [Release notes](https://github.com/nginxinc/nginx-prometheus-exporter/releases) - [Changelog](https://github.com/nginxinc/nginx-prometheus-exporter/blob/main/CHANGELOG.md) - [Commits](nginx/nginx-prometheus-exporter@v1.0.0...v1.1.0) --- updated-dependencies: - dependency-name: github.com/nginxinc/nginx-prometheus-exporter dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Paul Abel <128620221+pdabelf5@users.noreply.github.com> * patch base images on container build (#4869) --------- Signed-off-by: Haywood Shannon <5781935+haywoodsh@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Haywood Shannon <5781935+haywoodsh@users.noreply.github.com> Co-authored-by: Luca Comellini <luca.com@gmail.com> Co-authored-by: oseoin <oseoin@users.noreply.github.com> Co-authored-by: Venktesh Shivam Patel <ve.patel@f5.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent c36901c commit a376068

File tree

19 files changed

+393
-86
lines changed

19 files changed

+393
-86
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ echo "Updating versions: "
5555
echo "ic_version: ${current_ic_version} -> ${ic_version}"
5656
echo "helm_chart_version: ${current_helm_chart_version} -> ${helm_chart_version}"
5757

58+
regex_ic="s#$current_ic_version#$ic_version#g"
59+
regex_helm="s#$current_helm_chart_version#$helm_chart_version#g"
60+
5861
mv "${HELM_CHART_PATH}/values.schema.json" "${TMPDIR}/"
5962
jq --arg version "${ic_version}" \
6063
'.properties.controller.properties.image.properties.tag.default = $version | .properties.controller.properties.image.properties.tag.examples[0] = $version | .properties.controller.examples[0].image.tag = $version | .properties.controller.properties.image.examples[0].tag = $version | .examples[0].controller.image.tag = $version' \
@@ -74,8 +77,7 @@ for i in "${FILES_TO_UPDATE_IC_VERSION[@]}"; do
7477
fi
7578
file_name=$(basename "${i}")
7679
mv "${i}" "${TMPDIR}/${file_name}"
77-
regex="s#$current_ic_version#$ic_version#g"
78-
cat "${TMPDIR}/${file_name}" | sed -e "$regex" > "${i}"
80+
cat "${TMPDIR}/${file_name}" | sed -e "$regex_ic" > "${i}"
7981
if [ $? -ne 0 ]; then
8082
echo "ERROR: failed processing ${i}"
8183
mv "${TMPDIR}/${file_name}" "${i}"
@@ -90,8 +92,7 @@ for i in "${FILE_TO_UPDATE_HELM_CHART_VERSION[@]}"; do
9092
fi
9193
file_name=$(basename "${i}")
9294
mv "${i}" "${TMPDIR}/${file_name}"
93-
regex="s#$current_ic_version#$ic_version#g"
94-
cat "${TMPDIR}/${file_name}" | sed -e "$regex" > "${i}"
95+
cat "${TMPDIR}/${file_name}" | sed -e "$regex_helm" > "${i}"
9596
if [ $? -ne 0 ]; then
9697
echo "ERROR: failed processing ${i}"
9798
mv "${TMPDIR}/${file_name}" "${i}"
@@ -107,8 +108,7 @@ for i in ${docs_files}; do
107108
fi
108109
file_name=$(basename "${i}")
109110
mv "${i}" "${TMPDIR}/${file_name}"
110-
regex="s#$current_ic_version#$ic_version#g"
111-
cat "${TMPDIR}/${file_name}" | sed -e "$regex" > "${i}"
111+
cat "${TMPDIR}/${file_name}" | sed -e "$regex_ic" | sed -e "$regex_helm" > "${i}"
112112
if [ $? -ne 0 ]; then
113113
echo "ERROR: failed processing ${i}"
114114
mv "${TMPDIR}/${file_name}" "${i}"

.github/workflows/build-plus.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ jobs:
7171
password: ${{ steps.auth.outputs.access_token }}
7272
if: github.event_name != 'pull_request'
7373

74+
- name: Authenticate to Google Cloud Marketplace
75+
id: auth-mktpl
76+
uses: google-github-actions/auth@67e9c72af6e0492df856527b474995862b7b6591 # v2.0.0
77+
with:
78+
token_format: access_token
79+
workload_identity_provider: ${{ secrets.GCR_WORKLOAD_IDENTITY_MKTPL }}
80+
service_account: ${{ secrets.GCR_SERVICE_ACCOUNT_MKTPL }}
81+
if: github.ref_type == 'tag' && ! contains(inputs.target, 'aws')
82+
83+
- name: Login to GCR for Marketplace
84+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
85+
with:
86+
registry: gcr.io
87+
username: oauth2accesstoken
88+
password: ${{ steps.auth-mktpl.outputs.access_token }}
89+
if: github.ref_type == 'tag' && ! contains(inputs.target, 'aws')
90+
7491
- name: Configure AWS Credentials
7592
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
7693
with:
@@ -107,7 +124,8 @@ jobs:
107124
with:
108125
images: |
109126
name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}/nginx-plus-ingress
110-
name=docker-mgmt.nginx.com/nginx-ic${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}/nginx-plus-ingress,enable=${{ github.ref_type != 'pull_request' && ! startsWith(github.ref, 'refs/heads/release-') }}
127+
name=gcr.io/f5-7626-networks-public/nginxinc/nginx-plus-ingress${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }},enable=${{ github.ref_type == 'tag' && ! contains(inputs.target, 'aws') && ! contains(inputs.image, 'alpine') && ! contains(inputs.image, 'ubi') }}
128+
name=docker-mgmt.nginx.com/nginx-ic${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}/nginx-plus-ingress,enable=${{ github.ref_type != 'pull_request' && ! startsWith(github.ref, 'refs/heads/release-') && ! contains(inputs.target, 'aws') }}
111129
name=709825985650.dkr.ecr.us-east-1.amazonaws.com/nginx/nginx-plus-ingress${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }},enable=${{ github.ref_type == 'tag' && contains(inputs.target, 'aws') }}
112130
flavor: |
113131
suffix=${{ contains(inputs.image, 'ubi') && '-ubi' || '' }}${{ contains(inputs.image, 'alpine') && '-alpine' || '' }}${{ contains(inputs.target, 'aws') && '-mktpl' || '' }}${{ contains(inputs.image, 'fips') && '-fips' || ''}},onlatest=true
@@ -161,7 +179,7 @@ jobs:
161179
- name: AWS variables
162180
id: aws
163181
run: |
164-
aws_registry=$(echo "${{ steps.meta.outputs.tags }}" | grep -oP "709825985650.dkr.ecr.us-east-1.amazonaws.com/[^[:space:]]+")
182+
aws_registry=$(echo "${{ steps.meta.outputs.tags }}" | grep -oP "709825985650.dkr.ecr.us-east-1.amazonaws.com/[^[:space:]]+:${{ steps.meta.outputs.version }}")
165183
version=$(echo ${{ steps.meta.outputs.version }} | sed 's/-mktpl//')
166184
declare -A nap_mapping=(
167185
["waf"]=_NAP_WAF

.github/workflows/ci.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,17 @@ jobs:
282282
{\"image\": \"alpine\", \"marker\":\"'policies and not policies_rl and not policies_ac and not policies_jwt and not policies_mtls'\"}, \
283283
{\"image\": \"alpine\", \"marker\":\"'policies_rl or policies_ac or policies_jwt or policies_mtls'\"}, \
284284
{\"image\": \"debian\", \"marker\": \"'vs and not vs_ipv6 and not vs_rewrite and not vs_responses and not vs_grpc and not vs_redirects and not vs_externalname and not vs_externaldns and not vs_certmanager'\"}, \
285-
{\"image\": \"debian\", \"marker\": \"'vs_ipv6 or vs_rewrite or vs_responses or vs_grpc or vs_redirects or vs_externalname or vs_externaldns or vs_certmanager'\"}, \
286-
{\"image\": \"debian\", \"marker\": \"'vs_certmanager'\"}, \
285+
{\"image\": \"debian\", \"marker\": \"'vs_grpc or vs_redirects or vs_externalname or vs_externaldns'\"}, \
286+
{\"image\": \"debian\", \"marker\": \"'vs_responses or vs_ipv6 or vs_rewrite or vs_certmanager'\"}, \
287287
{\"image\": \"ubi\", \"marker\": \"ts\"}, \
288288
{\"image\": \"debian-plus\", \"marker\": \"'vs and not vs_ipv6 and not vs_rewrite and not vs_responses and not vs_grpc and not vs_redirects and not vs_externalname and not vs_externaldns and not vs_certmanager'\"}, \
289-
{\"image\": \"debian-plus\", \"marker\": \"'vs_ipv6 or vs_rewrite or vs_responses or vs_grpc or vs_redirects or vs_externalname or vs_externaldns or vs_certmanager'\"}, \
290-
{\"image\": \"debian-plus\", \"marker\": \"vs_certmanager\"}, \
289+
{\"image\": \"debian-plus\", \"marker\": \"'vs_grpc or vs_redirects or vs_externalname or vs_externaldns'\"}, \
290+
{\"image\": \"debian-plus\", \"marker\": \"'vs_responses or vs_ipv6 or vs_rewrite or vs_certmanager'\"}, \
291291
{\"image\": \"debian-plus\", \"marker\": \"ts\"}, \
292292
{\"image\": \"alpine-plus\", \"marker\":\"ingresses\"}, \
293293
{\"image\": \"alpine-plus\", \"marker\": \"vsr\"}, \
294-
{\"image\": \"ubi-plus\", \"marker\":\"'policies and not policies_rl and not policies_ac and not policies_jwt and not policies_mtls'\"}, \
295-
{\"image\": \"ubi-plus\", \"marker\":\"'policies_rl or policies_ac or policies_jwt or policies_mtls'\"}, \
296-
{\"image\": \"debian-plus-nap\", \"marker\": \"appprotect_integration\"}, \
294+
{\"image\": \"ubi-plus\", \"marker\":\"'policies and not policies_ac and not policies_jwt and not policies_mtls'\"}, \
295+
{\"image\": \"ubi-plus\", \"marker\":\"'policies_ac or policies_jwt or policies_mtls'\"}, \
297296
{\"image\": \"debian-plus-nap\", \"marker\": \"appprotect_waf_policies_allow\"}, \
298297
{\"image\": \"debian-plus-nap\", \"marker\": \"'appprotect_waf_policies and not appprotect_waf_policies_allow'\"}, \
299298
{\"image\": \"debian-plus-nap\", \"marker\": \"appprotect_waf_policies_grpc\"}, \
@@ -502,3 +501,24 @@ jobs:
502501
},
503502
})
504503
if: github.ref_type == 'tag'
504+
505+
gcp-marketplace:
506+
name: Trigger PR for GCP Marketplace
507+
runs-on: ubuntu-22.04
508+
needs: [checks, publish-helm]
509+
steps:
510+
- name:
511+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
512+
with:
513+
github-token: ${{ secrets.NGINX_PAT }}
514+
script: |
515+
await github.rest.actions.createWorkflowDispatch({
516+
owner: context.repo.owner,
517+
repo: 'kubernetes-ingress-gcp',
518+
workflow_id: 'sync-chart.yml',
519+
ref: 'main',
520+
inputs: {
521+
chart_version: '${{ needs.checks.outputs.chart_version }}'
522+
},
523+
})
524+
if: github.ref_type == 'tag'

build/Dockerfile

Lines changed: 22 additions & 4020 ; 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# syntax=docker/dockerfile:1.6
22
ARG BUILD_OS=debian
3-
ARG NGINX_PLUS_VERSION=R30
3+
ARG NGINX_PLUS_VERSION=R31
44
ARG DOWNLOAD_TAG=edge
5+
ARG DEBIAN_FRONTEND=noninteractive
56

67

78
############################################# Base images containing libs for Opentracing and FIPS #############################################
@@ -15,16 +16,19 @@ FROM nginx:1.25.3-alpine AS alpine
1516

1617
RUN --mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \
1718
apk add --no-cache libcap libstdc++ \
19+
&& apk upgrade --no-cache -U \
1820
&& cp -av /tmp/ot/usr/local/lib/libopentracing.so* /tmp/ot/usr/local/lib/libjaegertracing*so* /tmp/ot/usr/local/lib/libzipkin*so* /tmp/ot/usr/local/lib/libdd*so* /tmp/ot/usr/local/lib/libyaml*so* /usr/local/lib/ \
1921
&& cp -av /tmp/ot/usr/lib/nginx/modules/ngx_http_opentracing_module.so /usr/lib/nginx/modules/ \
20-
&& ldconfig /usr/local/lib/
22+
&& ldconfig /usr/local/lib/ \
23+
&& apk cache clean
2124

2225

2326
############################################# Base image for Debian #############################################
2427
FROM nginx:1.25.3 AS debian
2528

2629
RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
2730
apt-get update \
31+
&& apt-get upgrade -y \
2832
&& apt-get install --no-install-recommends --no-install-suggests -y libcap2-bin \
2933
&& rm -rf /var/lib/apt/lists/* \
3034
&& cp -av /tmp/ot/usr/local/lib/libopentracing.so* /tmp/ot/usr/local/lib/libjaegertracing*so* /tmp/ot/usr/local/lib/libzipkin*so* /tmp/ot/usr/local/lib/libdd*so* /tmp/ot/usr/local/lib/libyaml*so* /usr/local/lib/ \
@@ -47,6 +51,8 @@ LABEL name="NGINX Ingress Controller" \
4751
io.openshift.tags="nginx,ingress-controller,ingress,controller,kubernetes,openshift"
4852

4953
COPY --link --chown=101:0 LICENSE /licenses/
54+
RUN microdnf update -y \
55+
&& microdnf clean all
5056

5157

5258
############################################# NGINX files for NGINX Plus #############################################
@@ -69,9 +75,11 @@ ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/m
6975
ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/nap-waf-debian-11.repo nap-waf-11.sources
7076
ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/nap-dos-debian-11.repo nap-dos-11.sources
7177

72-
RUN --mount=from=busybox:musl,src=/bin/,dst=/bin/ printf "%s\n" "Acquire::https::pkgs.nginx.com::User-Agent \"k8s-ic-$IC_VERSION${BUILD_OS##debian-plus}-apt\";" >> 90pkgs-nginx \
78+
RUN --mount=from=busybox:musl,src=/bin/,dst=/bin/ printf "%s\n" "Acquire::https::pkgs.nginx.com::User-Agent k8s-ic-$IC_VERSION${BUILD_OS##debian-plus}-apt;" >> 90pkgs-nginx \
79+
&& printf "%s\n" "user_agent=k8s-ic-$IC_VERSION${BUILD_OS##ubi*plus}-dnf" | tee -a nginx-plus-*.repo \
7380
&& sed -i -e "s;%VERSION%;${NGINX_PLUS_VERSION};g" *.sources \
74-
&& sed -i -e "y/0/1/" -e "1,8s;/centos;/${NGINX_PLUS_VERSION}/centos;" *.repo
81+
&& sed -i -e "y/0/1/" -e "1,8s;/centos;/${NGINX_PLUS_VERSION}/centos;" *.repo \
82+
&& echo HTTP_USER_AGENT="k8s-ic-$IC_VERSION${BUILD_OS##alpine-plus}-apk" > user_agent
7583

7684

7785
############################################# Base image for Alpine with NGINX Plus #############################################
@@ -82,10 +90,14 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/apk/cert.pem,mode=0644 \
8290
--mount=type=secret,id=nginx-repo.key,dst=/etc/apk/cert.key,mode=0644 \
8391
--mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \
8492
--mount=type=bind,from=nginx-files,src=nginx_signing.rsa.pub,target=/etc/apk/keys/nginx_signing.rsa.pub \
85-
printf "%s\n" "https://pkgs.nginx.com/plus/${NGINX_PLUS_VERSION}/alpine/v$(grep -E -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
93+
--mount=type=bind,from=nginx-files,src=user_agent,target=/tmp/user_agent \
94+
export $(cat /tmp/user_agent) \
95+
&& printf "%s\n" "https://pkgs.nginx.com/plus/${NGINX_PLUS_VERSION}/alpine/v$(grep -E -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
96+
&& apk upgrade --no-cache -U \
8697
&& apk add --no-cache nginx-plus nginx-plus-module-njs nginx-plus-module-opentracing nginx-plus-module-fips-check libcap libcurl \
8798
&& cp -av /tmp/ot/usr/local/lib/libjaegertracing*so* /tmp/ot/usr/local/lib/libzipkin*so* /tmp/ot/usr/local/lib/libdd*so* /tmp/ot/usr/local/lib/libyaml*so* /usr/local/lib/ \
88-
&& ldconfig /usr/local/lib/
99+
&& ldconfig /usr/local/lib/ \
100+
&& apk cache clean
89101

90102

91103
############################################# Base image for Alpine with NGINX Plus and FIPS #############################################
@@ -109,6 +121,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
109121
--mount=type=bind,from=nginx-files,src=90pkgs-nginx,target=/etc/apt/apt.conf.d/90pkgs-nginx \
110122
--mount=type=bind,from=nginx-files,src=debian-plus-12.sources,target=/etc/apt/sources.list.d/nginx-plus.sources \
111123
apt-get update \
124+
&& apt-get upgrade -y \
112125
&& apt-get install --no-install-recommends --no-install-suggests -y sq ca-certificates libcap2-bin libcurl4 \
113126
&& groupadd --system --gid 101 nginx \
114127
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
@@ -136,6 +149,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
136149
--mount=type=bind,from=nginx-files,src=nap-dos-11.sources,target=/etc/apt/sources.list.d/app-protect-dos.sources \
137150
## the code below is duplicated from the debian-plus image because NAP doesn't support debian 12
138151
apt-get update \
152+
&& apt-get upgrade -y \
139153
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates sq \
140154
&& groupadd --system --gid 101 nginx \
141155
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
@@ -171,6 +185,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
171185
--mount=type=bind,from=nginx-files,src=nginx_signing.key,target=/tmp/nginx_signing.key \
172186
--mount=type=bind,from=nginx-files,src=nginx-plus-9.repo,target=/etc/yum.repos.d/nginx-plus.repo \
173187
microdnf --nodocs install -y shadow-utils \
188+
&& microdnf update -y \
174189
&& cat /etc/yum.repos.d/nginx-plus.repo \
175190
&& groupadd --system --gid 101 nginx \
176191
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
@@ -195,6 +210,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
195210
source /tmp/rhel_license \
196211
## the code below is duplicated from the ubi-plus image because NAP doesn't support UBI 9 and minimal versions
197212
dnf --nodocs install -y shadow-utils ca-certificates \
213+
&& dnf update -y \
198214
&& groupadd --system --gid 101 nginx \
199215
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
200216
&& rpm --import /tmp/nginx_signing.key \

cmd/nginx-ingress/main.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func main() {
7979
appProtectVersion = getAppProtectVersionInfo()
8080
}
8181

82-
updateSelfWithVersionInfo(kubeClient, version, nginxVersion, appProtectVersion)
82+
updateSelfWithVersionInfo(kubeClient, version, nginxVersion.String(), appProtectVersion)
8383

8484
templateExecutor, templateExecutorV2 := createTemplateExecutors()
8585

@@ -118,6 +118,7 @@ func main() {
118118
EnableCertManager: *enableCertManager,
119119
DynamicSSLReload: *enableDynamicSSLReload,
120120
StaticSSLPath: nginxManager.GetSecretsDir(),
121+
NginxVersion: nginxVersion,
121122
}
122123

123124
processNginxConfig(staticCfgParams, cfgParams, templateExecutor, nginxManager)
@@ -146,6 +147,7 @@ func main() {
146147
IsPrometheusEnabled: *enablePrometheusMetrics,
147148
IsLatencyMetricsEnabled: *enableLatencyMetrics,
148149
IsDynamicSSLReloadEnabled: *enableDynamicSSLReload,
150+
NginxVersion: nginxVersion,
149151
})
150152

151153
controllerNamespace := os.Getenv("POD_NAMESPACE")
@@ -400,17 +402,16 @@ func createNginxManager(managerCollector collectors.ManagerCollector) (nginx.Man
400402
return nginxManager, useFakeNginxManager
401403
}
402404

403-
func getNginxVersionInfo(nginxManager nginx.Manager) string {
404-
nginxVersion := nginxManager.Version()
405-
isPlus := strings.Contains(nginxVersion, "plus")
406-
glog.Infof("Using %s", nginxVersion)
405+
func getNginxVersionInfo(nginxManager nginx.Manager) nginx.Version {
406+
nginxInfo := nginxManager.Version()
407+
glog.Infof("Using %s", nginxInfo.String())
407408

408-
if *nginxPlus && !isPlus {
409+
if *nginxPlus && !nginxInfo.IsPlus {
409410
glog.Fatal("NGINX Plus flag enabled (-nginx-plus) without NGINX Plus binary")
410-
} else if !*nginxPlus && isPlus {
411+
} else if !*nginxPlus && nginxInfo.IsPlus {
411412
glog.Fatal("NGINX Plus binary found without NGINX Plus flag (-nginx-plus)")
412413
}
413-
return nginxVersion
414+
return nginxInfo
414415
}
415416

416417
func getAppProtectVersionInfo() string {

docs/content/technical-specifications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ _All images include NGINX 1.25.2._
6060

6161
### Images with NGINX Plus
6262

63-
_NGINX Plus images include NGINX Plus R30._
63+
_NGINX Plus images include NGINX Plus R31._
6464

6565
#### **F5 Container registry**
6666

0 commit comments

Comments
 (0)
0