k8sclient

package module
v0.1.0 Latest Latest
Warning

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

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

README

CircleCI

k8sclient

k8sclient provides a set of clients for interacting with Kubernetes resources.

  • pods, services, nodes, etc.
  • CRDs, CRs

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsUnexpectedStatusPhase

func IsUnexpectedStatusPhase(err error) bool

IsUnexpectedStatusPhase asserts notFoundError.

Types

type Clients

type Clients struct {
	// contains filtered or unexported fields
}

func NewClients

func NewClients(config ClientsConfig) (*Clients, error)

func (*Clients) CRDClient

func (c *Clients) CRDClient() k8scrdclient.Interface

func (*Clients) CtrlClient

func (c *Clients) CtrlClient() client.Client

func (*Clients) DynClient

func (c *Clients) DynClient() dynamic.Interface

func (*Clients) ExtClient

func (c *Clients) ExtClient() apiextensionsclient.Interface

func (*Clients) G8sClient

func (c *Clients) G8sClient() versioned.Interface

func (*Clients) K8sClient

func (c *Clients) K8sClient() kubernetes.Interface

func (*Clients) RESTClient

func (c *Clients) RESTClient() rest.Interface

func (*Clients) RESTConfig

func (c *Clients) RESTConfig() *rest.Config

func (*Clients) Scheme

func (c *Clients) Scheme() *runtime.Scheme

type ClientsConfig

type ClientsConfig struct {
	Logger micrologger.Logger
	// SchemeBuilder is an optional way to extend the known types to the global
	// client-go scheme. Make use of it for custom CRs.
	SchemeBuilder SchemeBuilder

	// KubeConfigPath and RestConfig are mutually exclusive.
	KubeConfigPath string
	// RestConfig and KubeConfigPath are mutually exclusive.
	RestConfig *rest.Config
}

type Interface

type Interface interface {
	CRDClient() k8scrdclient.Interface
	CtrlClient() client.Client
	DynClient() dynamic.Interface
	ExtClient() apiextensionsclient.Interface
	G8sClient() versioned.Interface
	K8sClient() kubernetes.Interface
	RESTClient() rest.Interface
	RESTConfig() *rest.Config
	Scheme() *runtime.Scheme
}

type SchemeBuilder

type SchemeBuilder []func(*runtime.Scheme) error

SchemeBuilder is an optional way to extend the known types to the global client-go scheme. Make use of it for custom CRs.

Typical usage:

k8sclient.SchemeBuilder{
	myapiversion.AddToShcheme,
}

type Setup

type Setup struct {
	// contains filtered or unexported fields
}

func NewSetup

func NewSetup(config SetupConfig) (*Setup, error)

func (*Setup) EnsureCRDCreated

func (*Setup) EnsureCRDDeleted

func (*Setup) EnsureNamespaceCreated

func (s *Setup) EnsureNamespaceCreated(ctx context.Context, namespace string) error

func (*Setup) EnsureNamespaceDeleted

func (s *Setup) EnsureNamespaceDeleted(ctx context.Context, namespace string) error

type SetupConfig

type SetupConfig struct {
	Clients *Clients
	Logger  micrologger.Logger
}

Directories

Path Synopsis
Package k8srestconfig provides interface to create client-go rest config which can be used to construct various clients.
Package k8srestconfig provides interface to create client-go rest config which can be used to construct various clients.

Jump to

Keyboard shortcuts

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