Update slightly obsolete / deprecated client library references in KNE - #750
Open
kraney wants to merge 2 commits into
Open
Update slightly obsolete / deprecated client library references in KNE#750kraney wants to merge 2 commits into
kraney wants to merge 2 commits into
Conversation
These are no longer in beta (for some time) use the official reference
…ients
Refactor Nokia node implementation and Metallb / Meshnet clientsets to use
standard client-go dynamic clients and static TypeMeta definitions, completely
eliminating sigs.k8s.io/controller-runtime as a direct dependency.
Summary of changes:
- topo/node/nokia/nokia.go:
- Replace controller-runtime Client (ctrlclient.New, c.Create, c.Delete)
with dynamic.NewForConfig and c.Resource(srlGVR).Namespace(ns).Create/Delete.
- Convert srlinuxv1.Srlinux resources to unstructured.Unstructured via
runtime.DefaultUnstructuredConverter, consistent with other KNE nodes.
- Remove newSrlinuxClientWithSchema and controller-runtime imports.
- api/metallb/clientset/v1beta1:
- In ipaddresspool.go and l2advertisement.go, assign TypeMeta statically
(Kind and metallbv1.GroupVersion) instead of calling apiutil.GVKForObject.
- In client.go, remove metallbv1.AddToScheme(Scheme) from init() to avoid
package initialization side-effects.
- Remove unused controller-runtime/pkg/client/apiutil imports.
- third_party/meshnet/api/clientset/v1beta1/topology.go:
- Assign TypeMeta statically (Kind: "Topology", topologyv1.SchemeGroupVersion)
instead of calling apiutil.GVKForObject.
- Remove unused apiutil import.
- go.mod & go.sum:
- Remove sigs.k8s.io/controller-runtime as a direct dependency.
Rationale:
- Simplifies KNE dependency tree by relying exclusively on client-go and
apimachinery rather than pulling in the full controller-runtime framework.
- Standardizes CRD creation and deletion across all node implementations.
- Avoids runtime reflection and scheme registration errors during clientset
initialization.
Note for googlers - see b/540005636 and cl/968544355
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
remove direct controller-runtime dependency and modernize CRD clients