[9.3](backport #4380) chore: upgrade trivy to v0.69.3 with GOEXPERIMENT=jsonv2#6310
Open
mergify[bot] wants to merge 1 commit into
Open
[9.3](backport #4380) chore: upgrade trivy to v0.69.3 with GOEXPERIMENT=jsonv2#6310mergify[bot] wants to merge 1 commit into
mergify[bot] wants to merge 1 commit into
Conversation
## Summary - Upgrades `github.com/aquasecurity/trivy` from `v0.66.0` to `v0.69.3` - Adds `GOEXPERIMENT=jsonv2` to all build paths — required because trivy v0.67+ imports Go's experimental `encoding/json/v2` packages which are only available at compile time when this flag is set - Removes transitive dependency on deprecated AWS SDK v1 (`github.com/aws/aws-sdk-go v1.55.8`) which was previously pulled in by trivy v0.66.0 - Co-upgrades 22 transitive dependencies (trivy-checks, trivy-db, opa v1.8→v1.11, helm v3.18→v3.19, k8s.io v0.33→v0.34, kustomize v0.19→v0.20, and others) ## Why GOEXPERIMENT=jsonv2 is needed Starting with trivy v0.67.0, trivy uses `encoding/json/v2` (Go's experimental next-gen JSON library) via `github.com/aquasecurity/trivy/pkg/x/json`. Without `GOEXPERIMENT=jsonv2` set at **compile time**, any `go build` that imports trivy fails with: ``` build constraints exclude all Go files in .../encoding/json/jsontext ``` Go 1.26.1 (already in use) satisfies the Go ≥ 1.25 requirement, but the flag is still required as `encoding/json/v2` remains experimental. ## Files changed | File | Change | |------|--------| | `go.mod` / `go.sum` | Bumped trivy + transitive deps | | `magefile.go` | `args.Env["GOEXPERIMENT"] = "jsonv2"` in `Build()` and `GolangCrossBuild()` | | `.buildkite/scripts/package.sh` | `export GOEXPERIMENT=jsonv2` after hermit activation | | `.github/workflows/packaging.yml` | Added to top-level `env:` | | `.github/workflows/ci-pull_request.yml` | New top-level `env:` block | | `.github/workflows/binary-size-monitor.yml` | Added to `env:` | | `.github/workflows/eks-ci.yml` | Added to `env:` | | `.github/actions/docker-images/action.yml` | Added to `Build cloudbeat binary` step `env:` | | `justfile` | Inline `GOEXPERIMENT=jsonv2` on `go build` in `build-binary` and `build-cloudbeat-debug` | ## Test plan - [x] `GOEXPERIMENT=jsonv2 go build ./...` — clean - [x] `GOEXPERIMENT=jsonv2 go vet ./...` — clean - [x] `go mod verify` — all modules verified - [x] `TestVulnerabilityWorker_Run` — PASS - [x] Full `go test ./...` (will run in CI) - [ ] Packaging CI (`packaging.yml`) validates cross-build path - [ ] Watch first Buildkite DRA pipeline on merge to confirm golang-crossbuild containers work See `trivy-upgrade-report.md` for the full analysis including DRA process breakdown. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> (cherry picked from commit cfd61d8) # Conflicts: # go.mod # go.sum
Contributor
Author
|
Cherry-pick of cfd61d8 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
7 tasks
Contributor
Author
|
This pull request is now in conflicts. Could you fix it? 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
github.com/aquasecurity/trivyfromv0.66.0tov0.69.3GOEXPERIMENT=jsonv2to all build paths — required because trivy v0.67+ imports Go's experimentalencoding/json/v2packages which are only available at compile time when this flag is setgithub.com/aws/aws-sdk-go v1.55.8) which was previously pulled in by trivy v0.66.0Why GOEXPERIMENT=jsonv2 is needed
Starting with trivy v0.67.0, trivy uses
encoding/json/v2(Go's experimental next-gen JSON library) viagithub.com/aquasecurity/trivy/pkg/x/json. WithoutGOEXPERIMENT=jsonv2set at compile time, anygo buildthat imports trivy fails with:Go 1.26.1 (already in use) satisfies the Go ≥ 1.25 requirement, but the flag is still required as
encoding/json/v2remains experimental.Files changed
go.mod/go.summagefile.goargs.Env["GOEXPERIMENT"] = "jsonv2"inBuild()andGolangCrossBuild().buildkite/scripts/package.shexport GOEXPERIMENT=jsonv2after hermit activation.github/workflows/packaging.ymlenv:.github/workflows/ci-pull_request.ymlenv:block.github/workflows/binary-size-monitor.ymlenv:.github/workflows/eks-ci.ymlenv:.github/actions/docker-images/action.ymlBuild cloudbeat binarystepenv:justfileGOEXPERIMENT=jsonv2ongo buildinbuild-binaryandbuild-cloudbeat-debugTest plan
GOEXPERIMENT=jsonv2 go build ./...— cleanGOEXPERIMENT=jsonv2 go vet ./...— cleango mod verify— all modules verifiedTestVulnerabilityWorker_Run— PASSgo test ./...(will run in CI)packaging.yml) validates cross-build pathSee
trivy-upgrade-report.mdfor the full analysis including DRA process breakdown.🤖 Generated with Claude Code
This is an automatic backport of pull request #4380 done by Mergify.