-
Notifications
You must be signed in to change notification settings - Fork 172
Upgrade controller-runtime from v0.2.2 to v0.5.0 and its dependencies. #504
Conversation
@yiqigao217 Feel free to take a look. |
/retest |
@sophieliu15: GitHub didn't allow me to assign the following users: cancel. Note that only kubernetes-sigs members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. 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. |
/test pull-hnc-test |
e01d127
to
7ea29e2
Compare
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.
Mainly a bunch of questions. One general comment - we're upgrading a bunch of things, not just controller-runtime, so maybe let's make the title of the commit and PR more general (e.g. "Upgrade golang, controller-runtime and other dependencies").
d036ebb
to
4f87cf6
Compare
The reason we upgraded everything else except controller-runtime was because we upgraded controller-runtime. How about "Upgrade controller-runtime and its dependencies"? |
The new title looks good |
28e54a5
to
99e1b7e
Compare
Reason for upgrade: The new version uses DynamicRESTMapper as default `RESTMapper` for controller runtime manager. `DynamicRESTMapper` will "reload the delegated `meta.RESTMapper` on a cache miss" (see kubernetes-sigs/controller-runtime#554), which can solve problem that we need to restart HNC after adding a new CRD to create corresponding object reconciler when using controller-runtime v0.2.2 (see details in kubernetes-retired#488). Incompatibility issues addressed in this PR: see PR description Tested: - Unit tests. - Went through demo script to make sure HNC behaves as expected on a GKE cluster. This partly solve: kubernetes-retired#488
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.
This is just an infra change so no need to bug Ryan.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrianludwin, sophieliu15 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 |
Reason for upgrade:
The new version uses DynamicRESTMapper as default
RESTMapper
for controller runtime manager.DynamicRESTMapper
will "reload the delegatedmeta.RESTMapper
on a cache miss" (see kubernetes-sigs/controller-runtime#554), which can solve problem that we need to restart HNC after adding a new CRD to create corresponding object reconciler when using controller-runtime v0.2.2 (see details in #488).Notice that in v0.5.0, when the GVK does not exist, the controller-runtime manager will create an object reconciler without failure. Instead, the object reconciler and manager will terminate after starting the object reconciler. This is expected (see kubernetes-sigs/controller-runtime#840). We will address this issue in a follow-up PR by explicitly checking if a GVK exists before creating the corresponding object reconciler.
This PR also solved following incompatibility issues caused by controller-runtime upgrade:
go.mod
andDockerfile
to 1.13. The errors.As in dynamicrestmapper.go requires go 1.13.go.mod
are updated automatically.sigs.k8s.io/controller-runtime/pkg/envtest/
tohttps://godoc.org/sigs.k8s.io/controller-runtime/pkg/envtest/printer
by this commit.ci-test.sh
because we upgraded k8s.io/api to v0.17.3 which did not haveWebhook
in v1beta1. If we do not upgrade controller-gen, we will get errorundefined: v1beta1.Webhook
in[email protected]
inpull-hnc-test
.kustomize
inci-test.sh
because otherwise it will downgradek8s.io/client-go
tov11.0.0
, which will cause an errornot enough arguments in call to watch.NewStreamWatcher
fromrest/request.go:598:31
inpull-hnc-test
Tested:
This partly solve: #488