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 k8s.io/api, k8s.io/client-go, k8s.io/apimachinery from 0.22.7 to 0.23.6 #6037

Merged
merged 1 commit into from
May 6, 2022

Conversation

mar4uk
Copy link
Contributor

@mar4uk mar4uk commented Apr 27, 2022

What this PR does / why we need it:
This PR bumps versions of k8s.io packages. This upgrade is needed to solve dependency issues when importing loki in other repositories where version of k8s.io is already upgraded.
For example, when I try to use loki in https://github.com/open-telemetry/opentelemetry-collector-contrib I face dependencies inconsistencies in modules which uses newer version of k8s.io packages:

go: finding module for package k8s.io/api/batch/v2alpha1
go: finding module for package k8s.io/api/auditregistration/v1alpha1
go: finding module for package k8s.io/api/settings/v1alpha1
github.com/open-telemetry/opentelemetry-collector-contrib/internal/components imports
	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver imports
	k8s.io/client-go/informers imports
	k8s.io/api/auditregistration/v1alpha1: module k8s.io/api@latest found (v0.23.6), but does not contain package k8s.io/api/auditregistration/v1alpha1
github.com/open-telemetry/opentelemetry-collector-contrib/internal/components imports
	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver imports
	k8s.io/client-go/informers imports
	k8s.io/api/batch/v2alpha1: module k8s.io/api@latest found (v0.23.6), but does not contain package k8s.io/api/batch/v2alpha1
github.com/open-telemetry/opentelemetry-collector-contrib/internal/components imports
	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver imports
	k8s.io/client-go/informers imports
	k8s.io/api/settings/v1alpha1: module k8s.io/api@latest found (v0.23.6), but does not contain package k8s.io/api/settings/v1alpha1

These packages: k8s.io/api/auditregistration/v1alpha1, k8s.io/api/batch/v2alpha1, k8s.io/api/settings/v1alpha1 are available in k8s.io@v.0.17.5, somehow loki brings this old version of k8s.io package when it uses k8s.io/api@v0.22.7

Updating k8s.io packages to v0.23.6 solves this dependency issue

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated
  • Is this an important fix or new feature? Add an entry in the CHANGELOG.md.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

@mar4uk mar4uk requested a review from a team as a code owner April 27, 2022 09:02
@CLAassistant
Copy link

CLAassistant commented Apr 27, 2022

CLA assistant check
All committers have signed the CLA.

@mar4uk mar4uk reopened this Apr 29, 2022
Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

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

Hey, thanks for the PR! I'm not against bumping these versions if it's helpful. I restarted the build to see if it will pass, but left a question about the exclude directive.

@@ -312,3 +314,5 @@ replace github.com/bradfitz/gomemcache => github.com/themihai/gomemcache v0.0.0-
replace github.com/thanos-io/thanos v0.22.0 => github.com/thanos-io/thanos v0.19.1-0.20211126105533-c5505f5eaa7d

replace github.com/cloudflare/cloudflare-go => github.com/cyriltovena/cloudflare-go v0.27.1-0.20211118103540-ff77400bcb93

exclude k8s.io/client-go v8.0.0+incompatible
Copy link
Member

Choose a reason for hiding this comment

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

I'm trying to understand this exclude directive -- can you help me understand what it helps with?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding exclude k8s.io/client-go v8.0.0+incompatible helps to keep version of github.com/influxdata/telegraf v1.16.3.
When I upgrade k8s.io/client-go to v0.23.6, go downgrades github.com/influxdata/telegraf to v0.10.1. When I upgrade telegraf back to v1.16.3, go upgrades k8s.io/client-go to v8.0.0+incompatible. But version v8.0.0+incompatible is actually older than v0.23.6.

exclude k8s.io/client-go v8.0.0+incompatible added to have both github.com/influxdata/telegraf v1.16.3 and k8s.io/client-go v0.23.6.
I took this solution from prometheus https://github.com/prometheus/prometheus/blob/main/go.mod#L102-L103.

Not sure if we need to exclude other pre-go-mod kubernetes tags here. I decided to go with as small diff as possible in this PR

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I think that's reasonable 👍

@owen-d owen-d merged commit c2e43dd into grafana:main May 6, 2022
@mar4uk mar4uk deleted the update-k8s-version branch May 9, 2022 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants