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

k8s: Bump k8s libraries to v0.30.0 #11840

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

RamLavi
Copy link
Contributor

@RamLavi RamLavi commented May 2, 2024

What this PR does

This PR bumps k8s vendor to v0.30.0 on go.mod files.
It also performs needed changes in order to comply with the new vendor libraries.

Note: This PR follows the update-k8s-dependencies. manual.

Fixes #

Why we need it and why it was done in this way

The following tradeoffs were made:

The following alternatives were considered:

Links to places where the discussion took place:

Special notes for your reviewer

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note

Bump k8s deps to 0.30.0

@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XXL labels May 2, 2024
@kubevirt-bot kubevirt-bot added area/virtctl sig/buildsystem Denotes an issue or PR that relates to changes in the build system. sig/observability Denotes an issue or PR that relates to observability. sig/scale sig/storage release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 2, 2024
pkg/virt-api/api.go Outdated Show resolved Hide resolved
@@ -39,7 +39,7 @@ func DefaultLeaderElectionConfiguration() Configuration {
LeaseDuration: metav1.Duration{Duration: DefaultLeaseDuration},
RenewDeadline: metav1.Duration{Duration: DefaultRenewDeadline},
RetryPeriod: metav1.Duration{Duration: DefaultRetryPeriod},
ResourceLock: resourcelock.EndpointsLeasesResourceLock,
ResourceLock: resourcelock.LeasesResourceLock,
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

@RamLavi RamLavi May 5, 2024

Choose a reason for hiding this comment

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

See here. Looks like that EndpointsLeasesResourceLock is deprecated.

Copy link
Contributor Author

@RamLavi RamLavi May 5, 2024

Choose a reason for hiding this comment

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

But for some reason the virt-controller endpoint is gone... trying to figure out why

Copy link
Contributor Author

@RamLavi RamLavi May 6, 2024

Choose a reason for hiding this comment

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

Well evidently this change made it so that the leader info is kept on the lease.
Fixed accordingly.
Added a comment on the commit desc.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, makes sense.

@@ -1,6 +1,8 @@
module kubevirt.io/client-go

go 1.21
go 1.22.0
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I saw a runtime log saying that it needed it.. will try to remove it back and see if I get it again.

Copy link
Contributor Author

@RamLavi RamLavi May 5, 2024

Choose a reason for hiding this comment

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

go: module ./staging/src/kubevirt.io/client-go requires go >= 1.22.0; switching to go1.22.2

Added a comment on the commit desc.

"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
"name": "fieldSelector",
"in": "query"
"$ref": "#/parameters/fieldSelector-xIcQKXFG"
Copy link
Contributor

Choose a reason for hiding this comment

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

swagger seems wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, sure looks odd. I counted about 19 of these. make apidoc passes. still checking..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tend to think it's OK. See here .
When I look at the output with the IDE, I don't see an issue though admittedly I am no expert.
@oshoval - WDYT? Does the output look OK to you now?

Copy link
Contributor

Choose a reason for hiding this comment

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

If IDE parse it then it sounds good
I am not familiar with it, better to ask someone who does
thanks

@RamLavi RamLavi force-pushed the bump_k8s_vendor_v0.30.0 branch 3 times, most recently from 8de6611 to f97cee5 Compare May 6, 2024 17:49
@RamLavi
Copy link
Contributor Author

RamLavi commented May 7, 2024

/retest-required

Copy link
Contributor

@jean-edouard jean-edouard left a comment

Choose a reason for hiding this comment

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

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jean-edouard

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

@kubevirt-bot kubevirt-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 7, 2024
@RamLavi
Copy link
Contributor Author

RamLavi commented Jun 5, 2024

we broke the streak!

removing hold
/hold cancel

trying again
/test pull-kubevirt-e2e-k8s-1.29-sig-monitoring

@RamLavi
Copy link
Contributor Author

RamLavi commented Jun 6, 2024

we broke the streak!

removing hold /hold cancel

trying again /test pull-kubevirt-e2e-k8s-1.29-sig-monitoring

pull-kubevirt-e2e-k8s-1.29-sig-monitoring failed, but on a different test.

@RamLavi
Copy link
Contributor Author

RamLavi commented Jun 6, 2024

/test pull-kubevirt-e2e-k8s-1.29-sig-monitoring

Comment on lines 202 to 204
if !errors.IsAlreadyExists(err) {
Expect(err).ToNot(HaveOccurred())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if !errors.IsAlreadyExists(err) {
Expect(err).ToNot(HaveOccurred())
}
Expect(err).To(Or(MatchError(errors.IsAlreadyExists, "IsAlreadyExists"), Not(HaveOccurred())))

I would align the code also in lines 195-197

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

My bad:

Expect(err).To(Or(Not(HaveOccurred(), MatchError(errors.IsAlreadyExists, "IsAlreadyExists"))))

Copy link
Contributor

Choose a reason for hiding this comment

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

@RamLavi I think you have to change the Expect as I suggested before retest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh I missed that. you're right. will change.

Copy link
Contributor Author

@RamLavi RamLavi Jun 9, 2024

Choose a reason for hiding this comment

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

Changed to:

Expect(err).To(Or(Not(HaveOccurred()), MatchError(errors.IsAlreadyExists, "IsAlreadyExists")))

@RamLavi
Copy link
Contributor Author

RamLavi commented Jun 6, 2024

/retest

1 similar comment
@RamLavi
Copy link
Contributor Author

RamLavi commented Jun 9, 2024

/retest

bumping of leader election added lease.
Since the lease controlled by the role-binding on a namespave level,
in order to recreate a VirtOperatorRESTErrorsBurst alert firing,
both the role-binding and the cluster-role-binding need to be
temporarily removed.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
@RamLavi
Copy link
Contributor Author

RamLavi commented Jun 9, 2024

/test pull-kubevirt-unit-test-arm64
looks like a flake

@fossedihelm
Copy link
Contributor

fossedihelm commented Jun 10, 2024

/lgtm
/hold
@oshoval @xpivarc @lyarwood @jean-edouard @Barakmor1 Since you commented, would you mind having another look and unhold in case? Thank you

@kubevirt-bot kubevirt-bot added lgtm Indicates that a PR is ready to be merged. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jun 10, 2024
@kubevirt-commenter-bot
Copy link

Required labels detected, running phase 2 presubmits:
/test pull-kubevirt-e2e-windows2016
/test pull-kubevirt-e2e-kind-sriov
/test pull-kubevirt-e2e-k8s-1.30-ipv6-sig-network
/test pull-kubevirt-e2e-k8s-1.28-sig-network
/test pull-kubevirt-e2e-k8s-1.28-sig-storage
/test pull-kubevirt-e2e-k8s-1.28-sig-compute
/test pull-kubevirt-e2e-k8s-1.28-sig-operator
/test pull-kubevirt-e2e-k8s-1.29-sig-network
/test pull-kubevirt-e2e-k8s-1.29-sig-storage
/test pull-kubevirt-e2e-k8s-1.29-sig-compute
/test pull-kubevirt-e2e-k8s-1.29-sig-operator

@oshoval
Copy link
Contributor

oshoval commented Jun 10, 2024

Did you take a look on those #11840 (comment) ?
Just some cosmetics, doesnt merit hold, but nice to have
thanks

@RamLavi
Copy link
Contributor Author

RamLavi commented Jun 10, 2024

Did you take a look on those #11840 (comment) ? Just some cosmetics, doesn't merit hold, but nice to have thanks

Hey @oshoval , thanks for the heads up. I prefer not to hold the PR for this specific change at this point.

Copy link
Member

@xpivarc xpivarc left a comment

Choose a reason for hiding this comment

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

There is one more thing that I am not sure about. The first commit could be split but no requirement

@@ -786,7 +786,7 @@ func (app *virtAPIApp) Compose() {
func (app *virtAPIApp) ConfigureOpenAPIService() {
config := openapi.CreateConfig()
config.GetDefinitions = v12.GetOpenAPIDefinitions
spec, err := builderv3.BuildOpenAPISpecFromRoutes(restfuladapter.AdaptWebServices(restful.RegisteredWebServices()), config)
spec, err := builder.BuildOpenAPISpecFromRoutes(restfuladapter.AdaptWebServices(restful.RegisteredWebServices()), config)
Copy link
Member

Choose a reason for hiding this comment

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

Why do we roll back?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once I bumped the k8s version there was a version inconsistency, and config (of type *common.Config, created by openapi.CreateConfig()) was no longer of the appropriate type (*common.OpenAPIV3Config).

They moved the config to the v3 API.

Anyways per your question - the reason is I thought it would be the least change to move to the old function to keep consistency, as changing to builderv3 will result in other bigger changes.

But if you think that we should bump swagger to v3 as well then we can do that.

@@ -39,7 +39,7 @@ func DefaultLeaderElectionConfiguration() Configuration {
LeaseDuration: metav1.Duration{Duration: DefaultLeaseDuration},
RenewDeadline: metav1.Duration{Duration: DefaultRenewDeadline},
RetryPeriod: metav1.Duration{Duration: DefaultRetryPeriod},
ResourceLock: resourcelock.EndpointsLeasesResourceLock,
ResourceLock: resourcelock.LeasesResourceLock,
Copy link
Member

Choose a reason for hiding this comment

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

Thanks, makes sense.

@RamLavi
Copy link
Contributor Author

RamLavi commented Jun 10, 2024

There is one more thing that I am not sure about. The first commit could be split but no requirement

I split it at the time to be more readable but eventually we must squash because the changes don't compile otherwise..

Signed-off-by: Ram Lavi <ralavi@redhat.com>
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 10, 2024
@kubevirt-bot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. and removed dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jun 10, 2024
@kubevirt-bot
Copy link
Contributor

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

📝 Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

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-sigs/prow repository. I understand the commands that are listed here.

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 10, 2024
@kubevirt-bot
Copy link
Contributor

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-sigs/prow repository.

@kubevirt-bot
Copy link
Contributor

@RamLavi: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-e2e-kind-1.27-vgpu f87f7cc link false /test pull-kubevirt-e2e-kind-1.27-vgpu
pull-kubevirt-unit-test-arm64 971d773 link false /test pull-kubevirt-unit-test-arm64
pull-kubevirt-e2e-arm64 971d773 link false /test pull-kubevirt-e2e-arm64
pull-kubevirt-conformance-arm64 971d773 link false /test pull-kubevirt-conformance-arm64
pull-kubevirt-unit-test 971d773 link true /test pull-kubevirt-unit-test
pull-kubevirt-build 971d773 link true /test pull-kubevirt-build
pull-kubevirt-build-arm64 971d773 link true /test pull-kubevirt-build-arm64
pull-kubevirt-fossa 971d773 link true /test pull-kubevirt-fossa
pull-kubevirt-client-python 971d773 link true /test pull-kubevirt-client-python
pull-kubevirt-generate 971d773 link true /test pull-kubevirt-generate
pull-kubevirt-goveralls 971d773 link false /test pull-kubevirt-goveralls
pull-kubevirt-verify-go-mod 971d773 link true /test pull-kubevirt-verify-go-mod
pull-kubevirt-prom-rules-verify 971d773 link true /test pull-kubevirt-prom-rules-verify
pull-kubevirt-check-unassigned-tests 971d773 link true /test pull-kubevirt-check-unassigned-tests
pull-kubevirt-apidocs 971d773 link true /test pull-kubevirt-apidocs
pull-kubevirt-code-lint 971d773 link true /test pull-kubevirt-code-lint
pull-kubevirt-manifests 971d773 link true /test pull-kubevirt-manifests
pull-kubevirt-check-tests-for-flakes 971d773 link false /test pull-kubevirt-check-tests-for-flakes
pull-kubevirt-e2e-k8s-1.30-sig-compute-migrations 971d773 link true /test pull-kubevirt-e2e-k8s-1.30-sig-compute-migrations
pull-kubevirt-e2e-k8s-1.29-sig-monitoring 971d773 link true /test pull-kubevirt-e2e-k8s-1.29-sig-monitoring
pull-kubevirt-e2e-k8s-1.30-sig-compute-serial 971d773 link true /test pull-kubevirt-e2e-k8s-1.30-sig-compute-serial
pull-kubevirt-e2e-k8s-1.30-sig-network 971d773 link true /test pull-kubevirt-e2e-k8s-1.30-sig-network
pull-kubevirt-e2e-k8s-1.30-sig-storage 971d773 link true /test pull-kubevirt-e2e-k8s-1.30-sig-storage
pull-kubevirt-e2e-k8s-1.30-sig-compute 971d773 link true /test pull-kubevirt-e2e-k8s-1.30-sig-compute
pull-kubevirt-e2e-k8s-1.30-sig-operator 971d773 link true /test pull-kubevirt-e2e-k8s-1.30-sig-operator
pull-kubevirt-e2e-k8s-1.29-sig-performance 971d773 link true /test pull-kubevirt-e2e-k8s-1.29-sig-performance

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-sigs/prow repository. I understand the commands that are listed here.

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. area/virtctl dco-signoff: no Indicates the PR's author has not DCO signed all their commits. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/buildsystem Denotes an issue or PR that relates to changes in the build system. sig/network sig/observability Denotes an issue or PR that relates to observability. sig/scale sig/storage size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet