Skip to content
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

⚠️ (go/v3) upgrade controller-runtime from 0.10.0 to 0.11.0, k8s from 1.22 to 1.23 and controller-gen from v0.0.7 to v0.8.0 #2471

Conversation

ankitm123
Copy link
Contributor

@ankitm123 ankitm123 commented Jan 6, 2022

Description

  • upgrade controller-runtime from 0.10.0 to 0.11.0
  • k8s from 1.22 to 1.23
  • controller-gen from v0.0.7 to v0.8.0

also, envtest setup from 1.22 to 1.23

NOTE: This pr changes the scaffolds produced by KB CLI for go/v3 plugin. The go/v2 plugin cannot be upgraded and has been kept as a legacy.

Signed-off-by: ankitm123 ankitmohapatra123@gmail.com

fixes #2448

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 6, 2022

CLA Signed

The committers are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jan 6, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @ankitm123!

It looks like this is your first PR to kubernetes-sigs/kubebuilder 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubebuilder has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 6, 2022
@ankitm123
Copy link
Contributor Author

ankitm123 commented Jan 6, 2022

Seems like for make install and make generate to work, it needs go1.17.
In case of go1.16, I am seeing these errors:

# sigs.k8s.io/json/internal/golang/encoding/json
../../../pkg/mod/sigs.k8s.io/json@v0.0.0-20211020170558-c049b76a60c6/internal/golang/encoding/json/encode.go:1249:12: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)
../../../pkg/mod/sigs.k8s.io/json@v0.0.0-20211020170558-c049b76a60c6/internal/golang/encoding/json/encode.go:1255:18: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)

I can try to track down the errors, probably need to pin some packages, if upgrade to go1.17 is undesired.
I also see #2446 addresses the upgrade to go1.17, so I can wait for that PR to go in, and then rebase (as I can see in that PR, tests need to be updated to use go1.17 🤔 )?

Basically structfield.IsExported was added in go 1.17, and hence requires go 1.17.
Pinning the version of k8s.io/apimachinery to v0.22.2 makes it work with go < 1.17

EDIT: I went ahead and pinned the version of apimachinary to v0.22.2, and that seems to pass install and unit tests locally for me.

@k8s-ci-robot
Copy link
Contributor

Hi @ankitm123. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 6, 2022
@ankitm123 ankitm123 changed the title chore: upgrade controller run time to 0.11 🌱 chore: upgrade controller run time to 0.11 Jan 6, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 6, 2022
@ankitm123 ankitm123 force-pushed the upgrade-controller-runtime-0-11 branch from 7ae4803 to 7ccdb85 Compare January 6, 2022 14:07
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 6, 2022
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution 🥇

Just a few nits:
a) To update the controller-runtime into the scaffolds is required to do the change in:
->

ControllerRuntimeVersion = "v0.10.0"

  • Then, run make generate to update all scaffolds.

b) Since the goal is the scaffolds began to use the new version we must use the mojo ':warning:' in the title. Also, since it is used to create our release notes WDYT about : :warning: (go/v3) upgrade controller-runtime from 0.10 to 0.11

Is it required to upgrade the go version as well? If yes, that we need to clarify that in the title, an update in the scaffolds as in the docs regards the go version required. E.g ( :warning: (go/v3) upgrade controller-runtime from 0.10 to 0.11, k8s to , and golang version to 1.17

@camilamacedo86
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 6, 2022
go.mod Outdated Show resolved Hide resolved
@ankitm123
Copy link
Contributor Author

Also, since it is used to create our release notes WDYT about : :warning: (go/v3) upgrade controller-runtime from 0.10 to 0.11

sgtm, will update.

@ankitm123 ankitm123 force-pushed the upgrade-controller-runtime-0-11 branch from 7ccdb85 to 34434ea Compare January 6, 2022 15:14
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 6, 2022
@ankitm123 ankitm123 changed the title 🌱 chore: upgrade controller run time to 0.11 ⚠️ (go/v3) upgrade controller-runtime from 0.10 to 0.11, k8s from 1.22 to 1.23 and golang version to 1.17 Jan 6, 2022
@ankitm123
Copy link
Contributor Author

ankitm123 commented Jan 6, 2022

@camilamacedo86 So I went forward and upgraded the go version in this PR along with the commit message. I will check why the PRs are failing, and update this PR.

@ankitm123 ankitm123 force-pushed the upgrade-controller-runtime-0-11 branch from 34434ea to e8ea885 Compare January 6, 2022 15:25
@ankitm123
Copy link
Contributor Author

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 10, 2022
@ankitm123 ankitm123 force-pushed the upgrade-controller-runtime-0-11 branch from 2676b9d to 58d8ecf Compare January 10, 2022 17:50
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 10, 2022
@varshaprasad96
Copy link
Member

/hold

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

…rom 1.22 to 1.23

Signed-off-by: ankitm123 <ankitmohapatra123@gmail.com>
@ankitm123 ankitm123 force-pushed the upgrade-controller-runtime-0-11 branch from 58d8ecf to c8b0546 Compare January 11, 2022 03:24
@ankitm123
Copy link
Contributor Author

All tests (except api-diff) passed finally! 🎉

@ankitm123
Copy link
Contributor Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 11, 2022
@camilamacedo86 camilamacedo86 changed the title ⚠️ (go/v3) upgrade controller-runtime from 0.10.0 to 0.11.0 and k8s from 1.22 to 1.23 ⚠️ (go/v3) upgrade controller-runtime from 0.10.0 to 0.11.0, k8s from 1.22 to 1.23 and controller-gen.kubebuilder.io/version: v0.7.0 and controller-gen from v0.0.7 to v0.8.0 Jan 11, 2022
@ankitm123 ankitm123 changed the title ⚠️ (go/v3) upgrade controller-runtime from 0.10.0 to 0.11.0, k8s from 1.22 to 1.23 and controller-gen.kubebuilder.io/version: v0.7.0 and controller-gen from v0.0.7 to v0.8.0 ⚠️ (go/v3) upgrade controller-runtime from 0.10.0 to 0.11.0, k8s from 1.22 to 1.23 and controller-gen from v0.0.7 to v0.8.0 Jan 11, 2022
@camilamacedo86
Copy link
Member

/lgtm

@varshaprasad96 wdyt can we move forward here?
See that the appdiff in this case does not seems be possible to comply with see: https://github.com/kubernetes-sigs/kubebuilder/runs/4770481855?check_suite_focus=true#step:5:49

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 11, 2022
@camilamacedo86
Copy link
Member

/override APIDiff

@k8s-ci-robot
Copy link
Contributor

@camilamacedo86: /override requires a failed status context or a job name to operate on.
The following unknown contexts were given:

  • APIDiff

Only the following contexts were expected:

  • cla/linuxfoundation
  • netlify/kubebuilder/deploy-preview
  • pull-kubebuilder-e2e-k8s-1-14-10
  • pull-kubebuilder-e2e-k8s-1-15-12
  • pull-kubebuilder-e2e-k8s-1-16-15
  • pull-kubebuilder-e2e-k8s-1-17-11
  • pull-kubebuilder-e2e-k8s-1-18-8
  • pull-kubebuilder-e2e-k8s-1-19-4
  • pull-kubebuilder-e2e-k8s-1-20-7
  • pull-kubebuilder-e2e-k8s-1-21-2
  • pull-kubebuilder-e2e-k8s-1-22-1
  • pull-kubebuilder-test
  • tide

In response to this:

/override APIDiff

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.

@camilamacedo86
Copy link
Member

/override ci/APIDiff

@k8s-ci-robot
Copy link
Contributor

@camilamacedo86: /override requires a failed status context or a job name to operate on.
The following unknown contexts were given:

  • ci/APIDiff

Only the following contexts were expected:

  • cla/linuxfoundation
  • netlify/kubebuilder/deploy-preview
  • pull-kubebuilder-e2e-k8s-1-14-10
  • pull-kubebuilder-e2e-k8s-1-15-12
  • pull-kubebuilder-e2e-k8s-1-16-15
  • pull-kubebuilder-e2e-k8s-1-17-11
  • pull-kubebuilder-e2e-k8s-1-18-8
  • pull-kubebuilder-e2e-k8s-1-19-4
  • pull-kubebuilder-e2e-k8s-1-20-7
  • pull-kubebuilder-e2e-k8s-1-21-2
  • pull-kubebuilder-e2e-k8s-1-22-1
  • pull-kubebuilder-test
  • tide

In response to this:

/override ci/APIDiff

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.

@camilamacedo86
Copy link
Member

/skip APIDiff

@ankitm123
Copy link
Contributor Author

ankitm123 commented Jan 11, 2022

It's a github check, and not prow, so override wont work 🤔 , needs to be done in gh(?).

@camilamacedo86
Copy link
Member

Hi @ankitm123

It's a github check, and not prow, so override wont work 🤔 , needs to be done in gh.

Yep. I was trying to see if we let it merge alone. I can force the merge anyway.
Let's just wait for @varshaprasad96 oks as well. then I can do that.

Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ankitm123, camilamacedo86, varshaprasad96

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump controller-runtime 0.11
4 participants