Skip to content

Update chainsaw and use go 1.26 - #62

Merged
ulucinar merged 3 commits into
crossplane:mainfrom
adamwg:awg/go-1.26
Oct 22, 2026
Merged

ulucinar merged 3 commits into
crossplane:mainfrom
adamwg:awg/go-1.26

Conversation

@adamwg

@adamwg adamwg commented May 19, 2026

Copy link
Copy Markdown
Member

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
adamwg force-pushed the awg/go-1.26 branch 3 times, most recently from 5680528 to 144add8 Compare October 20, 2026 22:42

@ulucinar ulucinar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adamwg for updating the dependencies. Left some comments for you to consider.

Comment thread internal/tester.go
Comment thread .github/workflows/ci.yml Outdated
Comment thread internal/tester.go
traceCmdArgs = fmt.Sprintf(`"${CROSSPLANE_CLI}" beta trace %s %s -n %s -o wide 2>>/tmp/uptest_crossplane_temp_errors.log`, r.KindGroup, r.Name, r.Namespace)
}
traceCmd := exec.Command("bash", "-c", traceCmdArgs) //nolint:gosec // Disabling gosec to allow dynamic shell command execution
traceCmd := exec.CommandContext(ctx, "bash", "-c", traceCmdArgs) //nolint:gosec // Disabling gosec to allow dynamic shell command execution

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for switching to CommandContext!

Comment thread Makefile Outdated
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>
@ulucinar
ulucinar merged commit eeeca73 into crossplane:main Oct 22, 2026
7 checks passed
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.

3 participants