kubeutil

package
v0.0.0-...-41c09db Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package kubeutil implements a collection of utility functions to simplify various manipulations of Kubernetes data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentContextName

func CurrentContextName(kubeconfigPath string) (string, error)

CurrentContextName returns the name of cluster used in the current context.

func Namespaces

func Namespaces(ulist *unstructured.UnstructuredList) []string

Namespaces returns the list of unique namespaces in an unstructured list.

func SplitGroupVersion

func SplitGroupVersion(groupVersion string) (string, string)

SplitGroupVersion parses an "apiVersion" string and returns the group and version separately.

func UnstructuredToConfigMap

func UnstructuredToConfigMap(u *unstructured.Unstructured) (*corev1.ConfigMap, error)

UnstructuredToConfigMap casts an unstructured object into a ConfigMap by serializing to JSON and deserializing into a ConfigMap.

Types

type Client

type Client struct {
	client.Client
	*discovery.DiscoveryClient
}

Client extends the Kubernetes client used in sigs.k8s.io/controller-runtime, but additionally embeds a discovery client.

func NewClient

func NewClient(cfg *rest.Config) (*Client, error)

NewClient initializes a new Kubernetes client.

Jump to

Keyboard shortcuts

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