Skip to content

Commit 6eef435

Browse files
committed
Fix merge-conflicts from main onto branch
2 parents 5e2bd87 + ae0ffa3 commit 6eef435

File tree

14 files changed

+532
-141
lines changed

14 files changed

+532
-141
lines changed

.github/kind-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
kind: Cluster
2+
apiVersion: kind.x-k8s.io/v1alpha4
3+
name: test-cluster
4+
nodes:
5+
- role: control-plane
6+
kubeadmConfigPatches:
7+
- |
8+
kind: InitConfiguration
9+
nodeRegistration:
10+
kubeletExtraArgs:
11+
node-labels: "ingress-ready=true"
12+
extraPortMappings:
13+
- containerPort: 80
14+
hostPort: 80
15+
protocol: TCP
16+
- containerPort: 443
17+
hostPort: 443
18+
protocol: TCP
19+
- role: worker
20+

.github/scripts/verify-contents.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
set -e
3+
4+
EXTRACTED_DIR="$1"
5+
6+
if [ -z "$EXTRACTED_DIR" ]; then
7+
echo "Usage: $0 <extracted_directory>"
8+
exit 1
9+
fi
10+
11+
echo "Verifying contents in directory: $EXTRACTED_DIR"
12+
13+
# Check if extraction directory exists
14+
if [ ! -d "$EXTRACTED_DIR" ]; then
15+
echo "Error: Extracted directory does not exist: $EXTRACTED_DIR"
16+
exit 1
17+
fi
18+
19+
# List of expected files/directories based on the common and NIC job lists
20+
EXPECTED_ITEMS=(
21+
"manifest.json"
22+
"supportpkg.log"
23+
"k8s/crd.json"
24+
"k8s/nodes.json"
25+
"k8s/version.json"
26+
)
27+
28+
# Check for expected items
29+
MISSING_ITEMS=()
30+
FOUND_ITEMS=()
31+
32+
for item in "${EXPECTED_ITEMS[@]}"; do
33+
FULL_PATH="$EXTRACTED_DIR/$item"
34+
if [ -e "$FULL_PATH" ]; then
35+
FOUND_ITEMS+=("$item")
36+
echo "✓ Found: $item"
37+
else
38+
MISSING_ITEMS+=("$item")
39+
echo "✗ Missing: $item"
40+
fi
41+
done
42+
43+
# Check if manifest.json is valid JSON and contains expected fields
44+
MANIFEST_FILE="$EXTRACTED_DIR/manifest.json"
45+
if [ -f "$MANIFEST_FILE" ]; then
46+
if jq empty "$MANIFEST_FILE" 2>/dev/null; then
47+
echo "✓ manifest.json is valid JSON"
48+
else
49+
echo "✗ manifest.json is not valid JSON"
50+
MISSING_ITEMS+=("valid manifest.json")
51+
fi
52+
fi
53+
54+
# Summary
55+
echo ""
56+
echo "=== VERIFICATION SUMMARY ==="
57+
echo "Found items: ${#FOUND_ITEMS[@]}"
58+
echo "Missing items: ${#MISSING_ITEMS[@]}"
59+
60+
if [ ${#MISSING_ITEMS[@]} -eq 0 ]; then
61+
echo "✅ All expected items found!"
62+
echo ""
63+
echo "Complete directory structure:"
64+
find "$EXTRACTED_DIR" -type f | sort | sed 's/^/ /'
65+
exit 0
66+
else
67+
echo "❌ Some expected items are missing:"
68+
for item in "${MISSING_ITEMS[@]}"; do
69+
echo " - $item"
70+
done
71+
echo ""
72+
echo "Actual directory structure:"
73+
find "$EXTRACTED_DIR" -type f | sort | sed 's/^/ /'
74+
exit 1
75+
fi

.github/workflows/docker-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
- name: List repository files
2727
run: ls -R .; pwd
2828
- name: Set up Docker Buildx
29-
uses: docker/setup-buildx-action@v3.10.0
29+
uses: docker/setup-buildx-action@v3.11.1
3030

3131
- name: Log in to GitHub Container Registry
32-
uses: docker/login-action@v3.4.0
32+
uses: docker/login-action@v3.5.0
3333
with:
3434
registry: ghcr.io
3535
username: ${{ github.repository_owner }}
@@ -46,7 +46,7 @@ jobs:
4646
ghcr.io/nginx/nginx-utils:latest
4747
4848
- name: Install Trivy and scan image for vulnerabilities
49-
uses: aquasecurity/trivy-action@0.31.0
49+
uses: aquasecurity/trivy-action@0.33.1
5050

5151
with:
5252
image-ref: ghcr.io/${{ github.repository_owner }}/nginx-utils:latest
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Integration Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ main ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
integration-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v4
19+
with:
20+
go-version: '1.24'
21+
22+
- name: Build binary
23+
run: |
24+
go build -o nginx-supportpkg main.go
25+
chmod +x nginx-supportpkg
26+
27+
- name: Create KinD cluster
28+
uses: helm/kind-action@v1.12.0
29+
with:
30+
cluster_name: test-cluster
31+
config: .github/kind-config.yaml
32+
33+
- name: Wait for cluster to be ready
34+
run: |
35+
kubectl wait --for=condition=Ready nodes --all --timeout=300s
36+
kubectl cluster-info
37+
38+
- name: Install NGINX Ingress Controller with Helm
39+
run: |
40+
# Install Helm (it's pre-installed on GitHub runners but ensure latest version)
41+
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
42+
43+
# Add and update helm repos (if needed)
44+
helm version
45+
46+
# Install NGINX Ingress Controller
47+
helm install my-release oci://ghcr.io/nginx/charts/nginx-ingress --version 2.2.2 \
48+
--namespace nginx-ingress --create-namespace
49+
50+
# Verify installation
51+
kubectl get pods -n nginx-ingress
52+
53+
- name: Wait for NGINX Ingress Controller to be ready
54+
run: |
55+
kubectl wait --namespace nginx-ingress \
56+
--for=condition=ready pod \
57+
--selector=app.kubernetes.io/instance=my-release \
58+
--timeout=300s
59+
kubectl get pods -A
60+
61+
- name: Run nginx-supportpkg tool
62+
run: |
63+
./nginx-supportpkg -n nginx-ingress -p nic
64+
65+
- name: Verify output file exists
66+
run: |
67+
ls -la *.tar.gz
68+
if [ ! -f *.tar.gz ]; then
69+
echo "Error: No tarball file found"
70+
exit 1
71+
fi
72+
echo "Tarball found: $(ls *.tar.gz)"
73+
74+
- name: Verify tarball is valid
75+
run: |
76+
TARBALL=$(ls *.tar.gz | head -n 1)
77+
echo "Testing tarball: $TARBALL"
78+
79+
# Test if it's a valid gzipped tarball
80+
if ! gzip -t "$TARBALL"; then
81+
echo "Error: File is not a valid gzip file"
82+
exit 1
83+
fi
84+
85+
# Test if it's a valid tar archive
86+
if ! tar -tzf "$TARBALL" >/dev/null 2>&1; then
87+
echo "Error: File is not a valid tar archive"
88+
exit 1
89+
fi
90+
91+
echo "Tarball is valid"
92+
93+
- name: Extract and verify contents
94+
run: |
95+
TARBALL=$(ls *.tar.gz | head -n 1)
96+
echo "Extracting tarball: $TARBALL"
97+
98+
# Extract to a test directory
99+
mkdir -p extracted_test
100+
tar -xzf "$TARBALL" -C extracted_test
101+
102+
# List all extracted contents
103+
echo "Extracted contents:"
104+
find extracted_test -type f | sort
105+
106+
# Verify expected files exist
107+
bash .github/scripts/verify-contents.sh extracted_test
108+
109+
- name: Upload test artifacts
110+
if: always()
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: integration-test-artifacts
114+
path: |
115+
*.tar.gz
116+
extracted_test/

.github/workflows/release-builder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
go-version: '1.24.3'
3232

3333
- name: Install Cosign
34-
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
34+
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
3535
with:
3636
cosign-release: 'v2.4.0'
3737

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ jobs:
5555

5656
# Upload the results to GitHub's code scanning dashboard.
5757
- name: "Upload to code-scanning"
58-
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
58+
uses: github/codeql-action/upload-sarif@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.30.0
5959
with:
6060
sarif_file: results.sarif

.krew.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
{{addURIAndSha "https://github.com/nginx/nginx-supportpkg-for-k8s/releases/download/{{ .TagName }}/kubectl-nginx_supportpkg_{{ .TagName }}_windows_arm64.tar.gz" .TagName }}
4343
bin: kubectl-nginx_supportpkg
4444
shortDescription: Collect support packages for NGINX products that run on k8s
45-
homepage: https://github.com/nginxinc/nginx-supportpkg-for-k8s
45+
homepage: https://github.com/nginx/nginx-supportpkg-for-k8s
4646
description: |
4747
Provides a single command to collect troubleshooting information
4848
for all NGINX products that run on k8s.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,7 @@ Running job helm-info... OK
9292
Running job helm-deployments... OK
9393
Supportpkg successfully generated: nic-supportpkg-1711384966.tar.gz
9494
95-
```
95+
```
96+
97+
## The nginx-utils Package
98+
Please refer to its dedicated [README](/nginx-utils/README.md).

go.mod

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ go 1.24.3
44

55
require (
66
github.com/mittwald/go-helm-client v0.12.18
7-
github.com/spf13/cobra v1.9.1
87
go.uber.org/mock v0.5.0
98
helm.sh/helm/v3 v3.18.4
10-
k8s.io/client-go v0.33.2
9+
github.com/spf13/cobra v1.10.1
10+
k8s.io/client-go v0.34.0
1111
)
1212

1313
require (
@@ -32,7 +32,7 @@ require (
3232
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
3333
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
3434
github.com/fatih/color v1.18.0 // indirect
35-
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
35+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
3636
github.com/go-errors/errors v1.5.1 // indirect
3737
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
3838
github.com/gobwas/glob v0.2.3 // indirect
@@ -66,39 +66,42 @@ require (
6666
github.com/opencontainers/image-spec v1.1.1 // indirect
6767
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
6868
github.com/pkg/errors v0.9.1 // indirect
69+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
6970
github.com/prometheus/client_model v0.6.2 // indirect
7071
github.com/prometheus/common v0.64.0 // indirect
7172
github.com/prometheus/procfs v0.16.1 // indirect
7273
github.com/rivo/uniseg v0.4.7 // indirect
7374
github.com/rubenv/sql-migrate v1.8.0 // indirect
7475
github.com/russross/blackfriday/v2 v2.1.0 // indirect
76+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
7577
github.com/shopspring/decimal v1.4.0 // indirect
7678
github.com/sirupsen/logrus v1.9.3 // indirect
7779
github.com/spf13/cast v1.8.0 // indirect
7880
github.com/x448/float16 v0.8.4 // indirect
79-
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
80-
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
81-
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
8281
github.com/xlab/treeprint v1.2.0 // indirect
8382
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
8483
go.opentelemetry.io/otel v1.36.0 // indirect
8584
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect
8685
go.opentelemetry.io/otel/metric v1.36.0 // indirect
8786
go.opentelemetry.io/otel/sdk v1.36.0 // indirect
8887
go.opentelemetry.io/otel/trace v1.36.0 // indirect
89-
golang.org/x/crypto v0.39.0 // indirect
90-
golang.org/x/sync v0.15.0 // indirect
88+
go.yaml.in/yaml/v2 v2.4.2 // indirect
89+
go.yaml.in/yaml/v3 v3.0.4 // indirect
90+
golang.org/x/crypto v0.40.0 // indirect
91+
golang.org/x/sync v0.16.0 // indirect
9192
google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect
9293
google.golang.org/grpc v1.72.1 // indirect
9394
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
94-
k8s.io/apiserver v0.33.2 // indirect
95-
k8s.io/cli-runtime v0.33.2 // indirect
96-
k8s.io/component-base v0.33.2 // indirect
97-
k8s.io/kubectl v0.33.2 // indirect
95+
helm.sh/helm/v3 v3.18.5 // indirect
96+
k8s.io/apiserver v0.34.0 // indirect
97+
k8s.io/cli-runtime v0.33.3 // indirect
98+
k8s.io/component-base v0.34.0 // indirect
99+
k8s.io/kubectl v0.33.3 // indirect
98100
oras.land/oras-go/v2 v2.6.0 // indirect
99101
sigs.k8s.io/kustomize/api v0.19.0 // indirect
100102
sigs.k8s.io/kustomize/kyaml v0.19.0 // indirect
101103
sigs.k8s.io/randfill v1.0.0 // indirect
104+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
102105
)
103106

104107
require (
@@ -109,32 +112,31 @@ require (
109112
github.com/go-openapi/jsonreference v0.21.0 // indirect
110113
github.com/go-openapi/swag v0.23.1 // indirect
111114
github.com/gogo/protobuf v1.3.2 // indirect
112-
github.com/google/gnostic-models v0.6.9 // indirect
115+
github.com/google/gnostic-models v0.7.0 // indirect
113116
github.com/google/uuid v1.6.0 // indirect
114117
github.com/josharian/intern v1.0.0 // indirect
115118
github.com/json-iterator/go v1.1.12 // indirect
116119
github.com/mailru/easyjson v0.9.0 // indirect
117120
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
118-
github.com/modern-go/reflect2 v1.0.2 // indirect
121+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
119122
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
120-
github.com/spf13/pflag v1.0.6 // indirect
121-
golang.org/x/net v0.40.0 // indirect
123+
github.com/spf13/pflag v1.0.9 // indirect
124+
golang.org/x/net v0.41.0 // indirect
122125
golang.org/x/oauth2 v0.30.0 // indirect
123-
golang.org/x/sys v0.33.0 // indirect
124-
golang.org/x/term v0.32.0 // indirect
125-
golang.org/x/text v0.26.0 // indirect
126+
golang.org/x/sys v0.34.0 // indirect
127+
golang.org/x/term v0.33.0 // indirect
128+
golang.org/x/text v0.27.0 // indirect
126129
golang.org/x/time v0.11.0 // indirect
127130
google.golang.org/protobuf v1.36.6 // indirect
128131
gopkg.in/inf.v0 v0.9.1 // indirect
129132
gopkg.in/yaml.v3 v3.0.1 // indirect
130-
k8s.io/api v0.33.2
131-
k8s.io/apiextensions-apiserver v0.33.2
132-
k8s.io/apimachinery v0.33.2
133+
k8s.io/api v0.34.0
134+
k8s.io/apiextensions-apiserver v0.34.0
135+
k8s.io/apimachinery v0.34.0
133136
k8s.io/klog/v2 v2.130.1 // indirect
134-
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
135-
k8s.io/metrics v0.33.2
136-
k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 // indirect
137+
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
138+
k8s.io/metrics v0.33.3
139+
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
137140
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
138-
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
139-
sigs.k8s.io/yaml v1.4.0 // indirect
141+
sigs.k8s.io/yaml v1.6.0 // indirect
140142
)

0 commit comments

Comments
 (0)