Skip to content

Update chainsaw and use go 1.26#62

Open
adamwg wants to merge 3 commits into
crossplane:mainfrom
adamwg:awg/go-1.26
Open

Update chainsaw and use go 1.26#62
adamwg wants to merge 3 commits into
crossplane:mainfrom
adamwg:awg/go-1.26

Conversation

@adamwg
Copy link
Copy Markdown
Member

@adamwg adamwg commented May 19, 2026

Description of your changes

The latest released version of kyverno/chainsaw breaks when used with go 1.26 because chainsaw depends on the internal testing.testDeps interface, which is not guaranteed to be stable and has changed in 1.26. In order to accommodate downstream projects using go 1.26, update our chainsaw dependency.

Moving to go 1.26 also requires us to migrate to golangci-lint v2, since there is no v1 release that supports go 1.26. Migrate our configuration with golangci-lint migrate. Add ignore-tests: true to the goconst configuration, since we have a bunch of literals used in test files that are not worth introducing consts for.

To appease the updated linter (and because it's a nice improvement), change our log handler goroutine functions to take a context rather than a chan bool for shutdown. We already have contexts at the call sites that get cancelled at the same time the old done channels were closed, so this is a straightforward change.

I have:

  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Existing unit and e2e tests.

adamwg added 2 commits May 19, 2026 14:23
The latest released version of kyverno/chainsaw breaks when used with go 1.26
because chainsaw depends on the internal `testing.testDeps` interface, which is
not guaranteed to be stable and has changed in 1.26. In order to accommodate
downstream projects using go 1.26, update our chainsaw dependency.

Moving to go 1.26 also requires us to migrate to golangci-lint v2, since there
is no v1 release that supports go 1.26. Migrate our configuration with
`golangci-lint migrate`. Add `ignore-tests: true` to the `goconst`
configuration, since we have a bunch of literals used in test files that are not
worth introducing consts for.

Signed-off-by: Adam Wolfe Gordon <awg@upbound.io>
Previously, our log collection goroutine functions took a `chan bool` for
orderly shutdown. We already have contexts in the places that call these, so
it's tidier (and makes the linter happy) to pass the contexts and use
`ctx.Done()` for shutdown.

Signed-off-by: Adam Wolfe Gordon <awg@upbound.io>
The Crossplane CLI code has moved into crossplane/cli.

Signed-off-by: Adam Wolfe Gordon <awg@upbound.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant