client

package
v0.9.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigKeyNamespace = "namespace"
)

Variables

This section is empty.

Functions

func Config

func Config(kubeconfig, kubecontext, baseName string) (*rest.Config, error)

Config returns a *rest.Config, using either the kubeconfig (if specified) or an in-cluster configuration.

func LoadConfig added in v0.7.0

func LoadConfig() (map[string]string, error)

LoadConfig loads the Ark client configuration file and returns it as a map[string]string. If the file does not exist, an empty map is returned.

func SaveConfig added in v0.7.0

func SaveConfig(config map[string]string) error

SaveConfig saves the passed in config map to the Ark client configuration file.

Types

type Creator added in v0.5.0

type Creator interface {
	// Create creates an object.
	Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
}

Creator creates an object.

type Dynamic

type Dynamic interface {
	Creator
	Lister
	Watcher
	Getter
}

Dynamic contains client methods that Ark needs for backing up and restoring resources.

type DynamicFactory

type DynamicFactory interface {
	// ClientForGroupVersionResource returns a Dynamic client for the given group/version
	// and resource for the given namespace.
	ClientForGroupVersionResource(gv schema.GroupVersion, resource metav1.APIResource, namespace string) (Dynamic, error)
}

DynamicFactory contains methods for retrieving dynamic clients for GroupVersionResources and GroupVersionKinds.

func NewDynamicFactory

func NewDynamicFactory(clientPool dynamic.ClientPool) DynamicFactory

NewDynamicFactory returns a new ClientPool-based dynamic factory.

type Factory

type Factory interface {
	// BindFlags binds common flags (--kubeconfig, --namespace) to the passed-in FlagSet.
	BindFlags(flags *pflag.FlagSet)
	// Client returns an ArkClient. It uses the following priority to specify the cluster
	// configuration: --kubeconfig flag, KUBECONFIG environment variable, in-cluster configuration.
	Client() (clientset.Interface, error)
	// KubeClient returns a Kubernetes client. It uses the following priority to specify the cluster
	// configuration: --kubeconfig flag, KUBECONFIG environment variable, in-cluster configuration.
	KubeClient() (kubernetes.Interface, error)
	Namespace() string
}

Factory knows how to create an ArkClient and Kubernetes client.

func NewFactory

func NewFactory(baseName string) Factory

NewFactory returns a Factory.

type Getter added in v0.5.0

type Getter interface {
	// Get fetches an object by name.
	Get(name string, opts metav1.GetOptions) (*unstructured.Unstructured, error)
}

Getter gets an object.

type Lister added in v0.5.0

type Lister interface {
	// List lists all the objects of a given resource.
	List(metav1.ListOptions) (runtime.Object, error)
}

Lister lists objects.

type Watcher added in v0.5.0

type Watcher interface {
	// Watch watches for changes to objects of a given resource.
	Watch(metav1.ListOptions) (watch.Interface, error)
}

Watcher watches objects.

Jump to

Keyboard shortcuts

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