-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨: deepcopy: gen: match Go 1.17 build tag format #595
Conversation
The Go team has started the process of replacing the old "// +build" constraints with the new "//go:build" constraints. See the design doc for more details here: https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md What is relevant is that in Go 1.17, gofmt now synchronizes the two styles. In particular, if gofmt is run against a deepcopy generated file, it will add a new "//go:build" constraint. See https://golang.org/doc/go1.17#gofmt for details. This PR intends to make it so that the generated code is compliant with the new gofmt style.
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Welcome @benpbrown! |
I have signed the CLA. |
Gentle ping for for review from the reviewers group (@droot @mengqiy @pwittrock @vincepri) |
Ping for review @droot @mengqiy @pwittrock @vincepri |
/assign @mengqiy |
Ping for review @droot @mengqiy @pwittrock @vincepri |
IHMO we need to update first k8s then controller runtime and then we can do this update here. See: operator-framework/operator-sdk#5208 (comment) |
Hi @camilamacedo86 thanks for your message. I understand that it would be desirable to upgrade the Go version used to compile Kubernetes (and related repos) all at once, but I don't quite follow the connection to this PR. This PR doesn't use Go 1.17 for building controller-tools (it still uses 1.16). The change is in the codegen emitted by controller-tools, which becomes forwards compatible with 1.17. Happily, the emitted code is backwards compatible with Go 1.16 (Go 1.16 added support for the new style build tags), so contributors will continue to use Go 1.16 on this repo. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, benpbrown The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/close |
@alvaroaleman: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/reopen |
@alvaroaleman: Reopened this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Update all current build tags `// +build` to new format accepted in go 1.17 `//go:build`. `zz_generated.deepcopy.go` files contains both tags because `controller-tools` does the migration smoothly (kubernetes-sigs/controller-tools#595).
Update all current build tags `// +build` to new format accepted in go 1.17 `//go:build`. `zz_generated.deepcopy.go` files contains both tags because `controller-tools` does the migration smoothly (kubernetes-sigs/controller-tools#595).
The Go team has started the process of replacing the old "// +build"
constraints with the new "//go:build" constraints. See the design
doc for more details here:
https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md
What is relevant is that in Go 1.17, gofmt now synchronizes the two
styles. In particular, if gofmt is run against a deepcopy generated
file, it will add a new "//go:build" constraint.
See https://golang.org/doc/go1.17#gofmt for details.
This PR intends to make it so that the generated code is compliant with
the new gofmt style.
Relevant issue: #594