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

Rebase k8s dependencies to 1.19-rc.2 #337

Merged
merged 4 commits into from
Jul 28, 2020

Conversation

damemi
Copy link
Contributor

@damemi damemi commented Jul 9, 2020

This is an in-place PR to start updating our deps to 1.19 for the upcoming 1.19 k8s release

Fixes #353

@damemi damemi requested review from seanmalloy and ingvagabund July 9, 2020 19:27
@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 Jul 9, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damemi

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 Jul 9, 2020
@damemi damemi mentioned this pull request Jul 9, 2020
4 tasks
@damemi
Copy link
Contributor Author

damemi commented Jul 9, 2020

/retest

@damemi
Copy link
Contributor Author

damemi commented Jul 9, 2020

Weird that these checks are failing CI, they pass locally for me and I'm running go 1.14.4 (same as the prow job image. Tested in a container:

$ docker run -it --rm -v $(pwd):/go/src/sigs.k8s.io/descheduler/.:Z golang:1.14.4 sh
# go version
go version go1.14.4 linux/amd64
# make verify
./hack/verify-gofmt.sh
./hack/verify-vendor.sh
go: downloading k8s.io/apimachinery v0.19.0-beta.2
go: downloading k8s.io/component-base v0.19.0-beta.2
go: downloading k8s.io/client-go v0.19.0-beta.2
go: downloading k8s.io/klog/v2 v2.1.0
(.........)
go: downloading github.com/mailru/easyjson v0.7.0
go: downloading github.com/kr/text v0.1.0
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: downloading github.com/emicklei/go-restful v2.9.5+incompatible
go: downloading github.com/PuerkitoBio/purell v1.1.1
go: downloading github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
Vendor Verified.
Removing ./hack/../_tmp/kube-vendor.3dNkBy
./_output/bin/golangci-lint run
./_output/bin/golangci-lint: 1: ./_output/bin/golangci-lint: ????: not found
./_output/bin/golangci-lint: 1: ./_output/bin/golangci-lint: Syntax error: "|" unexpected
make: *** [Makefile:88: lint] Error 2
# make test-unit
./test/run-unit-tests.sh
?   	sigs.k8s.io/descheduler/cmd/descheduler	[no test files]
?   	sigs.k8s.io/descheduler/cmd/descheduler/app	[no test files]
?   	sigs.k8s.io/descheduler/cmd/descheduler/app/options	[no test files]
?   	sigs.k8s.io/descheduler/pkg/api	[no test files]
?   	sigs.k8s.io/descheduler/pkg/api/v1alpha1	[no test files]
?   	sigs.k8s.io/descheduler/pkg/apis/componentconfig	[no test files]
?   	sigs.k8s.io/descheduler/pkg/apis/componentconfig/v1alpha1	[no test files]
ok  	sigs.k8s.io/descheduler/pkg/descheduler	0.506s
?   	sigs.k8s.io/descheduler/pkg/descheduler/client	[no test files]
ok  	sigs.k8s.io/descheduler/pkg/descheduler/evictions	0.078s
?   	sigs.k8s.io/descheduler/pkg/descheduler/evictions/utils	[no test files]
ok  	sigs.k8s.io/descheduler/pkg/descheduler/node	0.042s
ok  	sigs.k8s.io/descheduler/pkg/descheduler/pod	0.063s
?   	sigs.k8s.io/descheduler/pkg/descheduler/scheme	[no test files]
ok  	sigs.k8s.io/descheduler/pkg/descheduler/strategies	0.055s
?   	sigs.k8s.io/descheduler/pkg/utils	[no test files]
?   	sigs.k8s.io/descheduler/test	[no test files]

And I do get some error with golangci-lintbut the vendor should verify and the tests should pass...

@damemi
Copy link
Contributor Author

damemi commented Jul 9, 2020

I think it's some assumption we're making in our script that's messed up... I can sometimes get it to reproduce the failure by switching to master and running verify-vendor, but then running update-vendor fixes it (and produces no noticeable code changes)

@damemi
Copy link
Contributor Author

damemi commented Jul 9, 2020

Ok I can consistently reproduce this by switching between master and my new branch rebase-1.19:

$ git checkout rebase-1.19 
Switched to branch 'rebase-1.19'

$ hack/verify-vendor.sh 
(fails with the weird non-diffs we see in CI)

$ hack/update-vendor.sh
(no changes)

$ hack/verify-vendor.sh 
Vendor Verified.
Removing hack/../_tmp/kube-vendor.1xgx7F

$ git checkout master
Switched to branch 'master'

$ hack/verify-vendor.sh 
(fails again)

$ hack/update-vendor.sh
(no diff)

$ hack/verify-vendor.sh 
Vendor Verified.
Removing hack/../_tmp/kube-vendor.XP4DV4

I can go back and forth with this pattern forever, but it seems like hack/update-vendor.sh specifically (which only calls go mod tidy && go mod vendor) makes some change that fixes verify-vendor, but is ignored by git

It seems to be something about update-vendor that breaks verify-vendor on other branches. Because if I run an update on one branch, the other branch won't verify until I run an update on that branch, and then the first branch doesn't verify.

@damemi
Copy link
Contributor Author

damemi commented Jul 9, 2020

The problem is only related to OpenAPIV2 packages, related to the lowercasing of the new imports (see kubernetes/client-go#741 and the linked kube-openapi PR in that issue). This would explain why the diff doesn't show up in git

go mod vendor keeps resetting the OpenAPIV2 package name to caps on an older branch:

mdame@ibm-p9b-04-bmc[rebase-1.19] ~/go/src/sigs.k8s.io/descheduler$ git checkout master
Switched to branch 'master'
mdame@ibm-p9b-04-bmc[master] ~/go/src/sigs.k8s.io/descheduler$ ls vendor/github.com/googleapis/gnostic/
total 12K
drwxr-xr-x 6 mdame staff 192 Jul  9 17:23 .
drwxr-xr-x 3 mdame staff  96 Jul  9 17:23 ..
drwxr-xr-x 9 mdame staff 288 Jul  9 17:26 compiler
drwxr-xr-x 7 mdame staff 224 Jul  9 17:26 extensions
drwxr-xr-x 7 mdame staff 224 Jul  9 17:26 openapiv2
-rw-r--r-- 1 mdame staff 12K Jul  9 17:23 LICENSE
mdame@ibm-p9b-04-bmc[master] ~/go/src/sigs.k8s.io/descheduler$ hack/update-vendor.sh 
mdame@ibm-p9b-04-bmc[master] ~/go/src/sigs.k8s.io/descheduler$ ls vendor/github.com/googleapis/gnostic/
total 12K
drwxr-xr-x 6 mdame staff 192 Jul  9 17:26 .
drwxr-xr-x 3 mdame staff  96 Jul  9 17:26 ..
drwxr-xr-x 7 mdame staff 224 Jul  9 17:26 OpenAPIv2
drwxr-xr-x 9 mdame staff 288 Jul  9 17:26 compiler
drwxr-xr-x 7 mdame staff 224 Jul  9 17:26 extensions
-rw-r--r-- 1 mdame staff 12K Jul  9 17:26 LICENSE

which carries over when switching to the newer branch, so that's why I could switch between them and reproduce the issue. The rebase-1.19 (this) branch bumps the openapiv2 dependency to its new lowercase form. However, since git doesn't see the case change, it doesn't get committed and that's why it fails CI.

@damemi
Copy link
Contributor Author

damemi commented Jul 17, 2020

Need to make changes to update our policy conversion since default conversions no longer take place in 1.19 after kubernetes/kubernetes#90018

@damemi damemi changed the title [wip] Rebase upstream 1.19 Rebase k8s dependencies to 1.19-rc.2 Jul 27, 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 Jul 27, 2020
@damemi
Copy link
Contributor Author

damemi commented Jul 27, 2020

@seanmalloy @ingvagabund I just updated this PR to 1.19-rc2. If we want to merge this to get our master branch up to a "pre-release" state I'm ok with it, that will let us make sure our other ongoing changes right now will work with 1.19 and lets us update our CI as well. Then the eventual bump to GA 1.19 should just be smooth. What do you think?

@@ -35,12 +33,6 @@ const GroupName = "descheduler"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

func init() {
if err := addKnownTypes(scheme.Scheme); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the addKnownTypes function(lines 46 to 51) is no longer called. So should the addKnownTypes function just be removed from this file too?

I also noticed that some other files have their own addKnownTypes functions, so maybe these should be cleaned up too?

I'm honestly not sure if these need to be cleaned up or not, but just wanted to point this out just in case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, let me check these out. I think at least some of them can be removed if not all

Copy link
Contributor Author

@damemi damemi Jul 28, 2020

Choose a reason for hiding this comment

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

This addKnownTypes is still used by the SchemeBuilder: https://github.com/kubernetes-sigs/descheduler/blob/72946602bbc51c3aee3fe438120040a04e53cbdb/pkg/api/register.go#L25f0456cede4d61f48e51015136685ba1dR25

The others in ComponentConfig aren't called, but I think I need to update those to manually invoke AddToScheme like I did here

@ingvagabund
Copy link
Contributor

@seanmalloy @ingvagabund I just updated this PR to 1.19-rc2. If we want to merge this to get our master branch up to a "pre-release" state I'm ok with it, that will let us make sure our other ongoing changes right now will work with 1.19 and lets us update our CI as well. Then the eventual bump to GA 1.19 should just be smooth. What do you think?

Sounds good. As long as release-1.19 branch is cut after GA 1.19 rebase.

@damemi
Copy link
Contributor Author

damemi commented Jul 28, 2020

Sounds good. As long as release-1.19 branch is cut after GA 1.19 rebase.

Yeah that would be exactly the plan, to not cut release-1.19 until after 1.19 GA

@seanmalloy
Copy link
Member

/lgtm
/hold

@damemi these changes look good tome. Please remove the hold when you are ready for this to merge.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 28, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 28, 2020
@ingvagabund
Copy link
Contributor

Change gnostic/openapiv2 to lowercase in git

This will be troublesome every time someone runs go mod .... Hopefully, it will get fixed upstream soon.

/lgtm

@damemi
Copy link
Contributor Author

damemi commented Jul 28, 2020

Change gnostic/openapiv2 to lowercase in git

This will be troublesome every time someone runs go mod .... Hopefully, it will get fixed upstream soon.

/lgtm

This shouldn't be a problem once it's fixed here. It's really only a problem for case-insensitive filesystems (like Mac) which don't see the filename change when the version was bumped (and so, don't commit the change).

For that same reason, if anyone else is on a Mac they shouldn't see any change running go.mod, so nothing to worry about there. Just a hitch but from this version on it should be good

@damemi
Copy link
Contributor Author

damemi commented Jul 28, 2020

CI looks good, so I'll release the hold. Planned 1.19 GA is August 25, so this will give us some good soak time to catch any bugs (like #353, which this fixes so that's another reason to get it in sooner).

Thanks @seanmalloy and @ingvagabund
/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 Jul 28, 2020
@k8s-ci-robot k8s-ci-robot merged commit d0fbebb into kubernetes-sigs:master Jul 28, 2020
briend pushed a commit to briend/descheduler that referenced this pull request Feb 11, 2022
Rebase k8s dependencies to 1.19-rc.2
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. 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.

Logging is broken with the switch to klog/v2
4 participants