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

✨ Bump controller-runtime to v0.6.0 #2961

Closed
wants to merge 2 commits into from

Conversation

detiber
Copy link
Member

@detiber detiber commented Apr 24, 2020

What this PR does / why we need it:

  • Bumps the version of controller-runtime to v0.6.0

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2954

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 24, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: detiber

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 24, 2020
@detiber
Copy link
Member Author

detiber commented Apr 24, 2020

Still working through test failures, but at least a subset of them are related to kubernetes-sigs/controller-runtime#926

if err != nil {
return errors.Wrap(err, "unable to create jsonpatch for CoreDNS config map with backup Corefile")
}
if err := w.Client.Patch(ctx, cm, ctrlclient.RawPatch(types.JSONPatchType, patchData)); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Switched this up, since we were hitting an issue with the fake client not accepting Update without ResourceVersion being set for ConfigMaps (kubernetes-sigs/controller-runtime#926). This should result in the same net effect that we want.

Comment on lines +219 to +221
fakeClient := fake.NewFakeClientWithScheme(scheme.Scheme)
g.Expect(fakeClient.Create(context.TODO(), depl)).To(Succeed())
g.Expect(fakeClient.Create(context.TODO(), cm)).To(Succeed())
Copy link
Member Author

Choose a reason for hiding this comment

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

This might not be needed, this was introduced when I was testing to make sure the resourceVersioning behavior wasn't what was causing issues

@@ -1,2 +0,0 @@
The code in this directory has been copied from:
github.com/kubernetes/kubectl/pkg/drain@a17d91f9f5b34c73bed0bfc75b70bd762b725231
Copy link
Member Author

Choose a reason for hiding this comment

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

Good bye third_party/kubernetes-drain, you served us well 👋

@@ -51,8 +51,7 @@ func TestHelperUnstructuredPatch(t *testing.T) {
},
},
}
fakeClient := fake.NewFakeClientWithScheme(scheme.Scheme)
g.Expect(fakeClient.Create(ctx, obj)).To(Succeed())
fakeClient := fake.NewFakeClientWithScheme(scheme.Scheme, obj)
Copy link
Member Author

Choose a reason for hiding this comment

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

With controller-runtime v0.6.0 ResourceVersion behavior is different if resources are populated with NewFakeClientWithScheme (will not set a ResourceVersion if empty) compared to with Create (will set a ResourceVersion)

defer func() {
g.Expect(r.Client.Delete(context.Background(), otherNamespace))
}()
otherNamespaceName := otherNamespace.Name
Copy link
Member Author

Choose a reason for hiding this comment

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

This is needed because previously envtest was only allowing this due to disabling of admission plugins (namespace not existing already).

description: Required. The taint value corresponding
to the taint key.
description: The taint value corresponding to the taint
key.
Copy link
Member Author

Choose a reason for hiding this comment

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

This and other CRD yaml updates are related to the referenced api type description updates in k8s v1.18

@@ -356,7 +357,7 @@ func (r *MachineReconciler) drainNode(ctx context.Context, cluster *clusterv1.Cl
return errors.Errorf("unable to get node %q: %v", nodeName, err)
}

drainer := &kubedrain.Helper{
drainer := &drain.Helper{
Copy link
Member Author

Choose a reason for hiding this comment

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

Now that kubectl is out of tree we no longer need to maintain a copied version of the drain Helper.

@detiber
Copy link
Member Author

detiber commented Apr 27, 2020

The failing capd e2e tests seems like it's a bit racy anyway:

Expect(mgmtClient.Delete(ctx, &machineList.Items[0])).To(Succeed())
Eventually(func() (int, error) {
machineList := &clusterv1.MachineList{}
if err := mgmtClient.List(ctx, machineList, inClustersNamespaceListOption, matchClusterListOption); err != nil {
fmt.Println(err)
return 0, err
}
return len(machineList.Items), nil
}, "15m", "5s").Should(Equal(int(*controlPlane.Spec.Replicas) - 1))
By("ensuring a replacement machine is created")
Eventually(func() (int, error) {
machineList := &clusterv1.MachineList{}
if err := mgmtClient.List(ctx, machineList, inClustersNamespaceListOption, matchClusterListOption); err != nil {
fmt.Println(err)
return 0, err
}
return len(machineList.Items), nil
}, "15m", "30s").Should(Equal(int(*controlPlane.Spec.Replicas)))

It's trying to catch the period where the MachineList count is replicas-2 after manually deleting a Machine outside of the control of KCP, but is polling every 5s, so if the replacement is created before the next polling cycle the test will fail.

@detiber detiber changed the title [WIP] ✨ Bump controller-runtime to v0.6.0 ✨ Bump controller-runtime to v0.6.0 Apr 28, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 28, 2020
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Apr 28, 2020

@detiber: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-apidiff c6e4115 link /test pull-cluster-api-apidiff

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@detiber
Copy link
Member Author

detiber commented Apr 30, 2020

@vincepri this should be ready for review again.

@vincepri
Copy link
Member

vincepri commented May 1, 2020

Following yesterday's feedback in Slack, seems we should cut a new v0.4.0 release to include these breaking changes.

/milestone v0.4.0

@k8s-ci-robot k8s-ci-robot added this to the v0.4.0 milestone May 1, 2020
@vincepri vincepri mentioned this pull request May 3, 2020
@k8s-ci-robot
Copy link
Contributor

@detiber: PR needs rebase.

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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 7, 2020
@vincepri vincepri marked this pull request as draft May 7, 2020 19:12
@vincepri
Copy link
Member

@detiber Should we close this for now?

@detiber
Copy link
Member Author

detiber commented May 29, 2020

/close

@k8s-ci-robot
Copy link
Contributor

@detiber: Closed this PR.

In response to this:

/close

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.

@vincepri vincepri mentioned this pull request Jul 15, 2020
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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to Controller Runtime v0.6 once it releases
3 participants