chore: upgrade trivy to v0.69.3 with GOEXPERIMENT=jsonv2#4380
Conversation
|
This pull request does not have a backport label. Could you fix it @olegsu? 🙏
|
|
Caution The updated Mergify configuration is adding new deprecated fields:
|
|
This pull request is now in conflicts. Could you fix it? 🙏 |
5722066 to
7979a18
Compare
|
This pull request is now in conflicts. Could you fix it? 🙏 |
|
Update: created an environment with the changes from this PR,so far I dont see any unexpected logs |
a804144 to
653ce3f
Compare
653ce3f to
002988f
Compare
|
This pull request is now in conflicts. Could you fix it? 🙏 |
002988f to
97948a4
Compare
- Bump github.com/aquasecurity/trivy v0.66.0 -> v0.69.3 - Add GOEXPERIMENT=jsonv2 to magefile.go Build() and GolangCrossBuild() - Add GOEXPERIMENT=jsonv2 to all CI/CD build paths (Buildkite, GHA, justfile) - Remove transitive dep on deprecated aws-sdk-go v1.55.8 - Co-upgrade 22 transitive deps (trivy-checks, trivy-db, opa, helm, k8s.io, kustomize) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
97948a4 to
bc65815
Compare
|
This pull request is now in conflicts. Could you fix it? 🙏 |
- 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) 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. | 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` | - [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
|
@Mergifyio backport 9.4 |
✅ Backports have been createdDetails
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 |
Cherry-pick of #4380 onto 9.4 left unresolved conflict markers in go.mod and go.sum. Resolution strategy: - trivy v0.69.3, trivy-db, trivy-checks: cherry-pick side (upgrade goal) - aws-sdk-go-v2 and AWS service modules: HEAD side (9.4 Renovate bumps) - toqueteos/webbrowser, transparency-dev/formats: cherry-pick (new trivy deps) - golang.org/x/exp: HEAD (newer timestamp from 9.4 Renovate) - go.sum: union of both sides Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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