api

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package api implements helper functions for manipulating resources in a Kubernetes cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kubernetes

type Kubernetes interface {
	resources.UnstructuredOperations
	// Helpers returns helpers for the given namespace. If none is specified, "default" is used
	Helpers(namespace string) helpers.Helpers
}

Kubernetes defines an interface that extends kubernetes interface[k8s.io/client-go/kubernetes.Interface] adding generic functions that operate on any kind of object

func NewFromConfig

func NewFromConfig(c KubernetesConfig) (Kubernetes, error)

NewFromConfig returns a Kubernetes instance

type KubernetesConfig

type KubernetesConfig struct {
	// Context for executing kubernetes operations
	Context context.Context
	// kubernetes rest config
	Config *rest.Config
	// Client is a pre-configured dynamic client. If provided, the rest config is not used
	Client dynamic.Interface
	// Mapper is a pre-configured RESTMapper. If provided, the rest config is not used
	Mapper meta.RESTMapper
}

KubernetesConfig defines the configuration for creating a Kubernetes instance

Jump to

Keyboard shortcuts

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