Skip to content

Commit 674af4a

Browse files
martinszucclaude
andcommitted
Switch CI to Red Hat Go and add godebug fips140=auto
Add godebug fips140=auto directive to go.mod for FIPS auto-detection on RHEL systems. Replace actions/setup-go with the Red Hat Go container image (ubi9/go-toolset:1.26) in all CI workflows, since upstream Go does not recognize fips140=auto and panics at init. Drop --user root from CI containers Run as the container's default user (uid 1001) which matches the GitHub Actions runner user. Fixes permission-based tests that fail when running as root since root bypasses file permission checks. Fix git safe.directory for container-based CI Add safe.directory config step after checkout in all workflows to fix "dubious ownership" errors when running as root inside the Red Hat Go container while the workspace is owned by the runner user. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Martin Szuc <mszuc@redhat.com>
1 parent 429c164 commit 674af4a

5 files changed

Lines changed: 22 additions & 37 deletions

File tree

.github/workflows/build-test.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@ permissions:
1616
jobs:
1717
build:
1818
runs-on: ubuntu-latest
19+
container:
20+
image: registry.access.redhat.com/ubi9/go-toolset:1.26
1921
steps:
2022
- name: Checkout source code
2123
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
22-
- name: Add variables to environment file
23-
run: cat ".github/env" >> "$GITHUB_ENV"
24-
- name: Setup Go
25-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # pin@6.4.0
26-
with:
27-
go-version: '${{ env.GOLANG_VERSION }}'
28-
check-latest: true
24+
- name: Mark workspace as safe directory
25+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
2926
- name: Test source headers are present
3027
run: make test-source-headers
3128
- name: Check if go modules need to be tidied

.github/workflows/golangci-lint.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ jobs:
1111
golangci:
1212
name: golangci-lint
1313
runs-on: ubuntu-latest
14+
container:
15+
image: registry.access.redhat.com/ubi9/go-toolset:1.26
1416
steps:
1517
- name: Checkout
1618
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
19+
- name: Mark workspace as safe directory
20+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
1721
- name: Add variables to environment file
1822
run: cat ".github/env" >> "$GITHUB_ENV"
19-
- name: Setup Go
20-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # pin@6.4.0
21-
with:
22-
go-version: '${{ env.GOLANG_VERSION }}'
23-
check-latest: true
2423
- name: golangci-lint
2524
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee #pin@9.2.1
2625
with:

.github/workflows/govulncheck.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,15 @@ jobs:
1717
govulncheck:
1818
name: govulncheck
1919
runs-on: ubuntu-latest
20+
container:
21+
image: registry.access.redhat.com/ubi9/go-toolset:1.26
2022
steps:
2123
- name: Checkout
2224
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
2325
with:
2426
persist-credentials: false
25-
- name: Add variables to environment file
26-
run: cat ".github/env" >> "$GITHUB_ENV"
27-
- name: Setup Go
28-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # pin@6.4.0
29-
with:
30-
go-version: '${{ env.GOLANG_VERSION }}'
31-
check-latest: true
27+
- name: Mark workspace as safe directory
28+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
3229
- name: govulncheck
3330
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # pin@1.0.4
3431
with:

.github/workflows/release.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,15 @@ jobs:
1818
release:
1919
if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'helm/helm'
2020
runs-on: ubuntu-latest-16-cores
21+
container:
22+
image: registry.access.redhat.com/ubi9/go-toolset:1.26
2123
steps:
2224
- name: Checkout source code
2325
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
2426
with:
2527
fetch-depth: 0
26-
27-
- name: Add variables to environment file
28-
run: cat ".github/env" >> "$GITHUB_ENV"
29-
30-
- name: Setup Go
31-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # pin@6.4.0
32-
with:
33-
go-version: '${{ env.GOLANG_VERSION }}'
34-
check-latest: true
28+
- name: Mark workspace as safe directory
29+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
3530
- name: Run unit tests
3631
run: make test-coverage
3732
- name: Build Helm Binaries
@@ -83,20 +78,15 @@ jobs:
8378
canary-release:
8479
runs-on: ubuntu-latest-16-cores
8580
if: github.ref == 'refs/heads/main' && github.repository == 'helm/helm'
81+
container:
82+
image: registry.access.redhat.com/ubi9/go-toolset:1.26
8683
steps:
8784
- name: Checkout source code
8885
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
8986
with:
9087
fetch-depth: 0
91-
92-
- name: Add variables to environment file
93-
run: cat ".github/env" >> "$GITHUB_ENV"
94-
95-
- name: Setup Go
96-
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # pin@6.4.0
97-
with:
98-
go-version: '${{ env.GOLANG_VERSION }}'
99-
check-latest: true
88+
- name: Mark workspace as safe directory
89+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
10090

10191
- name: Run unit tests
10292
run: make test-coverage

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module helm.sh/helm/v4
22

33
go 1.26.0
44

5+
godebug fips140=auto
6+
57
require (
68
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24
79
github.com/BurntSushi/toml v1.6.0

0 commit comments

Comments
 (0)