Skip to content

Commit 213b0dd

Browse files
authored
Merge branch 'main' into main
Signed-off-by: Vincent Devillers <[email protected]>
2 parents 37fdd43 + c558320 commit 213b0dd

File tree

1,524 files changed

+138102
-194961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,524 files changed

+138102
-194961
lines changed

.codecov.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ coverage:
22
status:
33
project:
44
default:
5+
informational: true
56
target: auto
67
threshold: 0%
78
patch:
89
default:
10+
informational: true
911
target: auto
1012
threshold: 0%
1113
changes: false
14+
ignore:
15+
- "pkg/client"
16+
- "**/*generated*.go"

.fossa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ targets:
44
- type: setuptools
55
paths:
66
exclude:
7-
- docs
7+
- site
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Bug Report
2+
description: File a bug report.
3+
title: "[Bug]: "
4+
labels: ["bug", "needs triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report!
10+
- type: dropdown
11+
id: version
12+
attributes:
13+
label: Version
14+
description: What version of our F5 NGINX Ingress Controller are you running?
15+
options:
16+
- edge
17+
- 3.7.0
18+
- 3.6.2
19+
- 3.6.1
20+
- 3.6.0
21+
- 3.5.2
22+
- 3.5.1
23+
- 3.5.0
24+
- 3.4.3
25+
- 3.4.2
26+
- 3.4.1
27+
- 3.4.0
28+
- 3.3.2
29+
- 3.3.1
30+
- 3.3.0
31+
- 3.2.1
32+
- 3.2.0
33+
- 3.1.1
34+
- 3.1.0
35+
- 3.0.2
36+
- 3.0.1
37+
- 3.0.0
38+
- 2.4.2
39+
- 2.4.1
40+
- 2.4.0
41+
- 2.3.1
42+
- 2.3.0
43+
- 2.2.2
44+
- 2.2.1
45+
- 2.2.0
46+
- 2.1.2
47+
- 2.1.1
48+
- 2.1.0
49+
- 2.0.3
50+
- 2.0.2
51+
- 2.0.1
52+
- 2.0.0
53+
default: 0
54+
validations:
55+
required: true
56+
- type: dropdown
57+
id: platform
58+
attributes:
59+
label: What Kubernetes platforms are you running on?
60+
options:
61+
- Kind
62+
- Minikube
63+
- Rancher
64+
- EKS Amazon
65+
- AKS Azure
66+
- GKE Google Cloud
67+
- Openshift
68+
- Other
69+
default: 0
70+
validations:
71+
required: true
72+
- type: textarea
73+
id: steps-to-reproduce
74+
attributes:
75+
label: Steps to reproduce
76+
description: These steps will help us best reproduce the issue and come to a resolution.
77+
placeholder: |
78+
1. Deploy x to '...' using some.yaml
79+
2. View logs on '....'
80+
3. See error
81+
validations:
82+
required: true

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
### Proposed changes
2-
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue here in this description (not in the title of the PR).
2+
3+
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to
4+
that issue here in this description (not in the title of the PR).
35

46
### Checklist
7+
58
Before creating a PR, run through this checklist and mark each as complete.
69

710
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/kubernetes-ingress/blob/main/CONTRIBUTING.md) doc

.github/actionlint.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
self-hosted-runner:
2+
# Labels of self-hosted runner in array of strings.
3+
labels:
4+
- kic-plus
5+
# Configuration variables in array of strings defined in your repository or
6+
# organization. `null` means disabling configuration variables check.
7+
# Empty array means no configuration variable is allowed.
8+
config-variables: null
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Certify Openshift Image
2+
description: This action will attempt to certify an image for use in Openshift
3+
4+
inputs:
5+
image:
6+
description: The image manifest to certify in the format <registry>/<repository>:<tag>
7+
required: true
8+
project_id:
9+
description: The certification project id
10+
required: true
11+
pyxis_token:
12+
description: The Pyxis API Token
13+
required: true
14+
preflight_version:
15+
description: The version of the preflight utility to install
16+
required: false
17+
default: 1.9.1
18+
platforms:
19+
description: A comma separated list of architectures in the image manifest to certify
20+
required: false
21+
default: "amd64,arm64,ppc64le,s390x"
22+
submit:
23+
description: Submit results to Redhat PYAXIS
24+
required: false
25+
default: true
26+
27+
outputs:
28+
result:
29+
description: Did the certification succeed?
30+
value: ${{ steps.result.outputs.result == 0 && true || false }}
31+
32+
runs:
33+
using: composite
34+
steps:
35+
- name: Install openshift-preflight
36+
run: |
37+
curl -fsSL https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/${{ inputs.preflight_version }}/preflight-linux-amd64 --output preflight
38+
chmod +x preflight
39+
shell: bash
40+
41+
- name: Certify Images
42+
id: result
43+
run: |
44+
result=0
45+
if [ -z "${{ inputs.platforms }}" ]; then
46+
# list of platforms passed
47+
IFS=',' read -ra arch_list <<< "${{ inputs.platforms }}"
48+
for arch in "${arch_list[@]}"; do
49+
architecture=("${arch#*/}")
50+
./preflight check container ${{ inputs.image }} --pyxis-api-token ${{ inputs.pyxis_token }} --certification-project-id ${{ inputs.project_id }} --platform $architecture ${{ inputs.submit && '--submit' || '' }}
51+
if [ $? -ne 0 ]; then
52+
result=1
53+
fi
54+
done
55+
else
56+
# no platforms passed, this is either a manifest or a single platform image
57+
./preflight check container ${{ inputs.image }} --pyxis-api-token ${{ inputs.pyxis_token }} --certification-project-id ${{ inputs.project_id }} ${{ inputs.submit && '--submit' || '' }}
58+
result=$?
59+
fi
60+
echo "result=$result" >> $GITHUB_OUTPUT
61+
shell: bash
Lines changed: 62 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Run Smoke Tests
32
description: Run Smoke Tests for the project
43

@@ -10,110 +9,102 @@ inputs:
109
description: Timeout to use
1110
default: 75s
1211
required: false
13-
image:
14-
description: Docker image to use
15-
default: debian
12+
image-type:
13+
description: Image type to test
14+
required: true
15+
image-name:
16+
description: Docker image name to test
17+
required: true
18+
tag:
19+
description: Docker image tag to test
20+
required: true
21+
test-image:
22+
description: Test Docker image to use
23+
default: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/test-runner:latest
1624
required: false
1725
marker:
1826
description: Marker to use
1927
required: false
20-
nginx-key:
21-
description: Nginx key to use
28+
label:
29+
description: Label for test
30+
required: false
31+
azure-ad-secret:
32+
description: Azure Active Directory secret for JWKs
33+
required: false
34+
registry-token:
35+
description: JWT token for accessing container registry
2236
required: false
23-
nginx-crt:
24-
description: Nginx cert to use
37+
plus-jwt:
38+
description: JWT for NGINX Plus
2539
required: false
2640

2741
outputs:
2842
test-results-name:
2943
description: Test results name
30-
value: tests-${{ steps.k8s.outputs.cluster }}
44+
value: ${{ steps.k8s.outputs.test_name }}
45+
test-results-path:
46+
description: Test results full path
47+
value: ${{ steps.k8s.outputs.test_output_path }}
3148

3249
runs:
3350
using: composite
3451
steps:
35-
- name: Fetch Cached Artifacts
36-
uses: actions/cache@v3
37-
with:
38-
path: ${{ github.workspace }}/dist
39-
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }}-single
40-
41-
- name: Ingress type
42-
id: ingress-type
43-
run: |
44-
echo "name=nginx${{ contains(inputs.image, 'plus') && '-plus' || '' }}-ingress" >> $GITHUB_OUTPUT
45-
echo "tag=${{ inputs.image }}${{ contains(inputs.marker, 'dos') && '-dos' || '' }}${{ contains(inputs.marker, 'appprotect') && '-nap' || '' }}-${{ github.sha }}" >> $GITHUB_OUTPUT
46-
echo "modules=${{ contains(inputs.marker, 'appprotect') && 'waf' || '' }}${{ contains(inputs.marker, 'dos') && 'dos' || '' }}" >> $GITHUB_OUTPUT
47-
shell: bash
48-
49-
- name: Docker Buildx
50-
uses: docker/setup-buildx-action@v2
51-
52-
- name: Build ${{ inputs.image }} Container
53-
uses: docker/build-push-action@v3
54-
with:
55-
file: build/Dockerfile
56-
context: '.'
57-
cache-from: type=gha,scope=${{ inputs.image }}${{ contains(inputs.marker, 'dos') && '-dos' || '' }}${{ contains(inputs.marker, 'appprotect') && '-nap' || '' }}
58-
cache-to: type=gha,scope=${{ inputs.image }}${{ contains(inputs.marker, 'dos') && '-dos' || '' }}${{ contains(inputs.marker, 'appprotect') && '-nap' || '' }},mode=max
59-
target: goreleaser
60-
tags: 'docker.io/nginx/${{ steps.ingress-type.outputs.name }}:${{ steps.ingress-type.outputs.tag }}'
61-
load: true
62-
pull: true
63-
build-args: |
64-
BUILD_OS=${{ inputs.image }}
65-
IC_VERSION=CI
66-
${{ steps.ingress-type.outputs.modules != '' && format('NAP_MODULES={0}', steps.ingress-type.outputs.modules) || '' }}
67-
${{ contains(inputs.marker, 'appprotect') && 'DEBIAN_VERSION=buster-slim' || '' }}
68-
secrets: |
69-
${{ contains(inputs.image, 'plus') && format('"nginx-repo.crt={0}"', inputs.nginx-crt) || '' }}
70-
${{ contains(inputs.image, 'plus') && format('"nginx-repo.key={0}"', inputs.nginx-key) || '' }}
71-
72-
- name: Build Test-Runner Container
73-
uses: docker/build-push-action@v3
74-
with:
75-
file: tests/docker/Dockerfile
76-
context: '.'
77-
cache-from: type=gha,scope=test-runner
78-
cache-to: type=gha,scope=test-runner,mode=max
79-
tags: test-runner:${{ github.sha }}
80-
pull: true
81-
load: true
82-
8352
- name: Deploy Kubernetes
8453
id: k8s
8554
run: |
86-
kind create cluster --name ${{ github.run_id }} --image=kindest/node:v${{ inputs.k8s-version }} --config ${{ github.workspace }}/tests/ci-files/ci-kind-config.yaml --kubeconfig kube-${{ github.run_id }} --wait ${{ inputs.k8s-timeout }}
87-
kind load docker-image docker.io/nginx/${{ steps.ingress-type.outputs.name }}:${{ steps.ingress-type.outputs.tag }} --name ${{ github.run_id }}
88-
marker="${{ inputs.marker }}"
89-
sanitized_marker="${marker// /_}"
90-
name="${sanitized_marker:-${{ inputs.k8s-version }}}"
91-
echo "cluster_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${{ github.run_id }}-control-plane)" >> $GITHUB_OUTPUT
92-
echo "cluster=$(echo nginx-${{ inputs.image }}-$name)" >> $GITHUB_OUTPUT
55+
make -f tests/Makefile create-kind-cluster K8S_CLUSTER_NAME=${{ github.run_id }} K8S_CLUSTER_VERSION=${{ inputs.k8s-version }} K8S_TIMEOUT=${{ inputs.k8s-timeout }}
56+
make -f tests/Makefile image-load REGISTRY="" PREFIX=${{ inputs.image-name }} TAG=${{ inputs.tag }} K8S_CLUSTER_NAME=${{ github.run_id }}
57+
label="${{ inputs.label }}"
58+
nospaces="${label// /_}"
59+
noslash="${nospaces//\//_}"
60+
sanitized_marker="${noslash//\'/}"
61+
name="${sanitized_marker}-${{ inputs.k8s-version }}"
62+
cluster_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${{ github.run_id }}-control-plane)
63+
test_name=tests-nginx-${{ inputs.image-type }}-${name}.html
64+
test_output_path=${{ github.workspace }}/tests/${test_name}
65+
echo "cluster_ip=${cluster_ip}" >> $GITHUB_OUTPUT
66+
echo "test_name=${test_name}" >> $GITHUB_OUTPUT
67+
echo "test_output_path=${test_output_path}" >> $GITHUB_OUTPUT
68+
echo "Output:"
69+
echo " cluster_ip=${cluster_ip}"
70+
echo " test_output_path=${test_output_path}"
9371
shell: bash
9472

9573
- name: Setup Kubeconfig
9674
run: |
97-
sed -i 's|server:.*|server: https://${{ steps.k8s.outputs.cluster_ip }}:6443|' kube-${{ github.run_id }}
75+
sed -i 's|server:.*|server: https://${{ steps.k8s.outputs.cluster_ip }}:6443|' ~/.kube/kind/config
9876
shell: bash
9977

10078
- name: Run Smoke Tests
79+
id: smoke-tests
10180
run: |
102-
touch tests-${{ steps.k8s.outputs.cluster }}.html
81+
touch ${{ steps.k8s.outputs.test_output_path }}
10382
docker run --rm \
10483
--name test-runner-${{ github.run_id }} \
10584
--network=kind \
106-
-v ${{ github.workspace }}/tests/tests-${{ steps.k8s.outputs.cluster }}.html:/workspace/tests/tests-${{ steps.k8s.outputs.cluster }}.html \
107-
-v ${{ github.workspace }}/kube-${{ github.run_id }}:/root/.kube/config test-runner:${{ github.sha }} \
85+
-v "/var/run/docker.sock:/var/run/docker.sock" \
86+
-v ~/.docker:/root/.docker \
87+
-v ${{ github.workspace }}/tests:/workspace/tests \
88+
-v ${{ github.workspace }}/examples/common-secrets:/workspace/examples/common-secrets \
89+
-v ${{ github.workspace }}/deployments:/workspace/deployments \
90+
-v ${{ github.workspace }}/charts:/workspace/charts \
91+
-v ${{ github.workspace }}/config:/workspace/config \
92+
-v ${{ github.workspace }}/pyproject.toml:/workspace/pyproject.toml \
93+
-v ${{ steps.k8s.outputs.test_output_path }}:${{ steps.k8s.outputs.test_output_path }} \
94+
-v ~/.kube/kind/config:/root/.kube/config ${{ inputs.test-image }} \
95+
--docker-registry-user=oauth2accesstoken \
96+
--docker-registry-token=${{ inputs.registry-token }} \
10897
--context=kind-${{ github.run_id }} \
109-
--image=docker.io/nginx/${{ steps.ingress-type.outputs.name }}:${{ steps.ingress-type.outputs.tag }} \
98+
--image=${{ inputs.image-name }}:${{ inputs.tag }} \
11099
--image-pull-policy=Never \
111-
--ic-type=${{ steps.ingress-type.outputs.name }} \
100+
--ic-type=nginx${{ contains(inputs.image-type, 'plus') && '-plus' || '' }}-ingress \
112101
--service=nodeport --node-ip=${{ steps.k8s.outputs.cluster_ip }} \
113-
--html=tests-${{ steps.k8s.outputs.cluster }}.html \
102+
--html=${{ steps.k8s.outputs.test_output_path }} \
114103
--self-contained-html \
115104
--durations=10 \
116105
--show-ic-logs=yes \
106+
--ad-secret=${{ inputs.azure-ad-secret }} \
107+
--plus-jwt=${{ inputs.plus-jwt }} \
117108
-m ${{ inputs.marker != '' && inputs.marker || '""' }}
118109
working-directory: ./tests
119110
shell: bash

0 commit comments

Comments
 (0)