Kube-state-metrics: Update Kubernetes dependencies

Created on 29 Mar 2020  路  20Comments  路  Source: kubernetes/kube-state-metrics

Since v1.18.x is out, we need to update the client-go, k/api, and k/apimachinery dependencies

/help
/good-first-issue

help wanted

Most helpful comment

@lilic I can take a look this weekend.

All 20 comments

@tariq1890:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

Since v1.18.x is out, we need to update the client-go, k/api, and k/apimachinery dependencies

/help
/good-first-issue

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.

Once the latest kubernetes versions are specified in go.mod, be sure to run go mod vendor and check-in the resulting changeset.

client-go is not out yet from what I can tell. So this might need to wait for that. https://github.com/kubernetes/client-go#compatibility-matrix

/assign Prabhakar-17

The problem with this its a larger change due to the client-go changing its signature of the functions. So this might be a larger contribution. There is a tool that help with the migration.

@lilic Thanks for pointing that out. I鈥檒l remove the labels for now.

Since @Prabhakar-17 has already contributed to this repo, he should be able to take this on :)

@tariq1890 Thank you, I will work on this.
@lilic Thank you for the info. Could you please tell the name of the tool.

This is the repo that should help with migration from client-go 1.17 and client-go 1.18 https://github.com/kubernetes-sigs/clientgofix

@Prabhakar-17 are you still interested in working on this, otherwise lets unassign you? :)

@lilic yes, I am interested. I was getting few errors, will give another try over this weekend.

Okay, feel free to write here the issues you faced, thanks!

If I remember correctly, the verticalpodautoscaler dependency didn't support the v0.18.x versions of client-go

I have raised this issue. Hoping for a response from the autoscaler maintainers: https://github.com/kubernetes/autoscaler/issues/3219

I opened a PR with those changes here https://github.com/kubernetes/autoscaler/pull/3098

The PR was merged @Prabhakar-17 do you have time within the next week to do this change, as we want to do an alpha release next week. Thanks! :)

@lilic I can take a look this weekend.

Thanks! Let us know if you need any help :). This will need some code changes since you'll have to add the extra context parameter

This tool helps with that https://github.com/kubernetes-sigs/clientgofix But yes let us know if you need anything!

Update: have created a draft PR, facing some issues. I was not able to find much time to fix it, will take a look again. thanks
Updated the dependency version and ran the tool lilic suggested.

error:

# k8s.io/kube-state-metrics/internal/store
internal/store/poddisruptionbudget.go:90:31: p.Status.PodDisruptionsAllowed undefined (type "k8s.io/api/policy/v1beta1".PodDisruptionBudgetStatus has no field or method PodDisruptionsAllowed)
internal/store/verticalpodautoscaler.go:262:74: not enough arguments in call to vpaClient.AutoscalingV1beta2().VerticalPodAutoscalers(ns).List
    have ("k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions)
    want (context.Context, "k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions)
internal/store/verticalpodautoscaler.go:265:75: not enough arguments in call to vpaClient.AutoscalingV1beta2().VerticalPodAutoscalers(ns).Watch
    have ("k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions)
    want (context.Context, "k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions)
FAIL    k8s.io/kube-state-metrics [build failed]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikekap picture mikekap  路  8Comments

lilic picture lilic  路  3Comments

stvnwrgs picture stvnwrgs  路  7Comments

jackzampolin picture jackzampolin  路  8Comments

terinjokes picture terinjokes  路  4Comments