-
Notifications
You must be signed in to change notification settings - Fork 78
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
Update dependencies to Kubernetes v1.21.1 #361
Conversation
04f154d
to
954c2da
Compare
Build is failing because Go 1.13 is used. I've opened kubernetes/test-infra#22350 to update it. |
/test cli-utils-presubmit-master |
5ecd241
to
f51a170
Compare
$(GOPATH)/bin/addlicense -y 2020 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE . | ||
|
||
verify-license: | ||
(which $(GOPATH)/bin/addlicense || go get github.com/google/addlicense) | ||
(which $(GOPATH)/bin/addlicense || go install github.com/google/addlicense@6d92264d717064f28b32464f0f9693a5b4ef0239) # latest as of 2021-05-27 |
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.
Pinned dependency versions
0e4873b
to
becffbd
Compare
@@ -99,7 +99,7 @@ expectedOutputLine "1" | |||
invName=$(kubectl get cm -n test-namespace --selector='cli-utils.sigs.k8s.io/inventory-id' --no-headers | awk '{print $1}') | |||
|
|||
# There should be one config map that is not the inventory object | |||
kubectl get cm -n test-namespace --selector='!cli-utils.sigs.k8s.io/inventory-id' --no-headers | wc -l > $OUTPUT/status | |||
kubectl get cm -n test-namespace --selector='name=test-config-map-label' --no-headers | wc -l > $OUTPUT/status |
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.
There is a new ConfigMap
kube-root-ca.crt
now, so made this more robust.
NAME DATA AGE
cm-a 0 2s
cm-b 0 2s
cm-c 0 2s
kube-root-ca.crt 1 7s
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.
Previously kind
was creating Kubernetes v1.19.1 and now it creates v1.21.1.
k8s.io/cli-runtime v0.21.1 | ||
k8s.io/client-go v0.21.1 | ||
k8s.io/klog/v2 v2.9.0 | ||
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e // indirect |
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.
Otherwise it's resolved to an older version, which is incompatible. This version contains the gnostic
bump from kubernetes/kube-openapi#220. Kubernetes master
uses gnostic 0.5.1
too.
fields := d.GetManagedFields() | ||
Expect(fields[0].Manager).To(Equal("test")) | ||
|
||
By("Verify APIService is client-side applied") | ||
By("Verify APIService is server-side applied") |
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.
1.19.1 didn't support this, 1.21.1 does.
@mortent this is finally ready for review. Cheers. |
Should klog be also updated to klog/v2? |
/lgtm |
You are right. |
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.
Thanks for all the work. One small nitpick. I'll merge this quickly once we've added the comments. Let's be on the lookout for version skew issues.
/lgtm
@@ -65,7 +65,7 @@ func serversideApplyTest(c client.Client, invConfig InventoryConfig, inventoryNa | |||
}, apiService) | |||
Expect(err).NotTo(HaveOccurred()) | |||
_, found2 := apiService.GetAnnotations()[v1.LastAppliedConfigAnnotation] | |||
Expect(found2).To(Equal(true)) | |||
Expect(found2).To(BeFalse()) |
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.
Adding a comment that LastAppliedConfigAnnotation
is only set for client-side apply, and we've server-side applied here would make this easier for others to follow.
@@ -47,11 +47,11 @@ func serversideApplyTest(c client.Client, invConfig InventoryConfig, inventoryNa | |||
}, &d) | |||
Expect(err).NotTo(HaveOccurred()) | |||
_, found := d.ObjectMeta.Annotations[v1.LastAppliedConfigAnnotation] | |||
Expect(found).To(Equal(false)) | |||
Expect(found).To(BeFalse()) |
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.
We didn't add sufficient comments initially, but we might want to comment somewhere about the difference of client-side (sets LastAppliedConfigAnnotation
) vs. server-side apply (sets field managers) to help explain the tests.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ash2k, seans3 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 |
Mostly to drop old Kustomize and other old dependency versions so that this library plays nicer with downstream consumers that want to use more modern versions.
Edit: Switched all
go get
togo install
becausego get
modifiesgo.mod
/go.sum
files while installing a package andgo install
does not. We want the later beacuse we're not adding the dependency, just installing something to use for code generation/etc. See https://golang.org/doc/go1.16#go-command