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

feat(k8s): Update Kubernetes client-go to latest 1.26 release #250

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

karlskewes
Copy link
Contributor

@karlskewes karlskewes commented Jan 28, 2023

Tested on 1.22.15 and 1.26.0 with https://kind.sigs.k8s.io/

v0.26.1 is the latest release for the latest maintained version of
Kubernetes.
The fake client now requires additional data to fully represent what
a real client provides (namely, the List kind).
@karlskewes karlskewes marked this pull request as draft January 28, 2023 04:05
@karlskewes karlskewes marked this pull request as ready for review January 28, 2023 04:10
@karlskewes
Copy link
Contributor Author

Some in cluster testing.

Without RBAC permissions:

W0128 04:20:20.731932       1 reflector.go:424] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:169: failed to list *unstructured.Unstructured: prometheusrules.monitoring.coreos.com is forbidden: User "system:serviceaccount:default:sloop" cannot list resource "prometheusrules" in API group "monitoring.coreos.com" at the cluster scope

With RBAC permissions:

I0128 04:23:13.753916       1 kubewatcher.go:142] Found 8 CRD definitions
I0128 04:23:13.754066       1 kubewatcher.go:153] Stopping 0 CRD Informers

And the kinds show up in the UI, have events and data, etc.
sloop-client-go-26 1-crd-kinds

@karlskewes karlskewes marked this pull request as draft January 28, 2023 04:33
@karlskewes karlskewes marked this pull request as ready for review January 28, 2023 04:42
Copy link
Contributor Author

@karlskewes karlskewes left a comment

Choose a reason for hiding this comment

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

Still need to solve for #214

@@ -212,7 +212,7 @@ func stopUnwantedCrdInformers(existing map[crdGroupVersionResourceKind]*crdInfor
}

func getCrdList(crdClient clientset.Interface) ([]crdGroupVersionResourceKind, error) {
crdList, err := crdClient.ApiextensionsV1().CustomResourceDefinitions().List(metav1.ListOptions{})
crdList, err := crdClient.ApiextensionsV1().CustomResourceDefinitions().List(context.TODO(), metav1.ListOptions{})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't have an existing ctx to use so we can use context.TODO() to keep existing behaviour.

pkg/sloop/ingress/kubewatcher_test.go Show resolved Hide resolved
@sana-jawad sana-jawad merged commit 8f3e179 into salesforce:master Feb 7, 2023
@karlskewes karlskewes deleted the client-go-26.1 branch February 7, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants