Closed zchenyu closed 1 year ago
The question is, how did it pass the CI when I made the PR?
Seems CI explicitly uses 1.19 https://github.com/kubernetes/kube-openapi/blob/master/.github/workflows/ci.yml#L15 To use the go.mod version, you can do: https://github.com/actions/setup-go#getting-go-version-from-the-gomod-file
I'm getting a similar issue in GitHub Actions after trying to upgrade my project to 1.21:
# k8s.io/kube-openapi/pkg/cached
/github/home/go/pkg/mod/k8s.io/kube-openapi@v0.0.0-20230501164219-8b0f38b5fd1f/pkg/cached/cache.go:242:16: undefined: atomic.Pointer
note: module requires Go 1.19
However, it builds locally when I run go build ./...
, and I was previously on 1.20, not 1.19. So how on earth was this package being loaded properly if it's truly requiring 1.19.
So how on earth was this package being loaded properly if it's truly requiring 1.19.
I'm not entirely sure what you mean, it should work with 1.19+, it doesn't specifically requires 1.19 (i.e. 1.20 should work).
Seems CI explicitly uses 1.19 https://github.com/kubernetes/kube-openapi/blob/master/.github/workflows/ci.yml#L15 To use the go.mod version, you can do: https://github.com/actions/setup-go#getting-go-version-from-the-gomod-file
we should definitely use the go.mod version, sounds like it's time to tear apart the matrix.
@apelisse I did figure out the docker image I was using actually had a lower version of Go installed... I had downgraded that docker image, and therefore, it also downgraded the Go version.
@apelisse I did figure out the docker image I was using actually had a lower version of Go installed... I had downgraded that docker image, and therefore, it also downgraded the Go version.
Thanks for clarifying!
I've created #418 for ci to use the go.mod version.
This seems to have been introduced in https://github.com/kubernetes/kube-openapi/pull/371
I believe the fix is to bump the Go version in go.mod to 1.19 https://github.com/kubernetes/kube-openapi/blob/15aac26d736acfa8584df8030fef87eef2ca1921/go.mod#L3