Documentation ¶
Index ¶
- Variables
- func Create[T any, PT AddrofObject[T]](ctx context.Context, ctl *Ctl, obj T) (*T, error)
- func Delete[T any, PT AddrofObject[T]](ctx context.Context, ctl *Ctl, key ObjectKey) error
- func Get[T any, PT AddrofObject[T]](ctx context.Context, ctl *Ctl, key ObjectKey) (*T, error)
- func List[T any, L ObjectList[T]](ctx context.Context, ctl *Ctl, opts ...client.ListOption) (*T, error)
- func RestToConfig(cfg *rest.Config) clientcmdapi.Config
- type AddrofObject
- type Ctl
- func (c *Ctl) Create(ctx context.Context, obj Object) error
- func (c *Ctl) Delete(ctx context.Context, obj Object) error
- func (c *Ctl) Exec(ctx context.Context, pod *corev1.Pod, opts ExecOptions) error
- func (c *Ctl) Get(ctx context.Context, key ObjectKey, obj Object) error
- func (c *Ctl) RestConfig() *rest.Config
- type ExecOptions
- type Object
- type ObjectKey
- type ObjectList
- type RESTConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var WriteToFile = clientcmd.WriteToFile
Functions ¶
func Create ¶
Get is a generic equivalent of Ctl.Create.
func Delete ¶
Get is a generic equivalent of Ctl.Delete.
func List ¶
func List[T any, L ObjectList[T]](ctx context.Context, ctl *Ctl, opts ...client.ListOption) (*T, error)
List is a generic equivalent of [Ctl.List].
func RestToConfig ¶
func RestToConfig(cfg *rest.Config) clientcmdapi.Config
Types ¶
type AddrofObject ¶
AddrofObject is a helper type constraint for accepting a struct value that implements the Object interface.
type Ctl ¶
type Ctl struct {
// contains filtered or unexported fields
}
Ctl is a Kubernetes client inspired by the shape of the `kubectl` CLI with a focus on being ergonomic.
func (*Ctl) Get ¶
Get fetches the latest state of an object into `obj` from Kubernetes. Usage:
var pod corev1.Pod ctl.Get(ctx, kube.ObjectKey{Namespace: "", Name:""}, &pod)
func (*Ctl) RestConfig ¶
RestConfig returns a deep copy of the rest.Config used by this Ctl.
type ExecOptions ¶
type ObjectList ¶
type ObjectList[T any] interface { client.ObjectList *T }
ObjectList is a generic equivalent of ObjectList.
type RESTConfig ¶
Click to show internal directories.
Click to hide internal directories.