generic

package
v0.0.0-...-dca6437 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient[T runtime.Object](gvr schema.GroupVersionResource, config *rest.Config) client[T]

Ideally, this wouldn't need to take a GVR, and it could just be inferred from the runtime.Object type given.

In practice, this doesn't seem to be straightforward. :(

Things that implement runtime.Object tend to be pointer types (e.g., *corev1.Pod), which means T is nil, and we can't call GetObjectKind() on it to start to guess at the GVR.

It might be possible to use schemes to lookup the GVR for a given Go type (assuming it's been registered), which could let us get rid of this. In the meantime, taking a GVR removes ambiguity at the cost of verbosity. /shrug

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL