k8s

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Module provides a K8sClient.

func Providek8sDynamicClient

func Providek8sDynamicClient(in K8sClientConstructorIn) (dynamic.Interface, error)

Providek8sDynamicClient provides a dynamic kubernetes client.

Types

type K8sClient

type K8sClient interface {
	GetClientSet() *kubernetes.Clientset
	GetErr() error
	GetErrNotInCluster() bool
}

K8sClient provides an interface for kubernetes client.

func Providek8sClient

func Providek8sClient(in K8sClientConstructorIn) K8sClient

Providek8sClient provides a new kubernetes client and sets logger.

type K8sClientConstructorIn

type K8sClientConstructorIn struct {
	fx.In
	K8sClient *http.Client `name:"k8s-http-client"`
}

K8sClientConstructorIn holds parameter for Providek8sClient and Providek8sDynamicClient.

type RealK8sClient

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

RealK8sClient implements kubernetes client set.

func NewK8sClient

func NewK8sClient(clientSet *kubernetes.Clientset, err error) *RealK8sClient

NewK8sClient returns a new kubernetes client.

func (*RealK8sClient) GetClientSet

func (r *RealK8sClient) GetClientSet() *kubernetes.Clientset

GetClientSet returns the kubernetes client set.

func (*RealK8sClient) GetErr

func (r *RealK8sClient) GetErr() error

GetErr returns the error of the client.

func (*RealK8sClient) GetErrNotInCluster

func (r *RealK8sClient) GetErrNotInCluster() bool

GetErrNotInCluster returns true if client's error equals to ErrNotInCluster, unable to load in-cluster configuration.

Jump to

Keyboard shortcuts

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