kclient

package
v0.0.0-...-0a339b4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultQPS   = rest.DefaultQPS * 3
	DefaultBurst = rest.DefaultBurst * 3
)
View Source
const Kubeconfig util.EnvironmentVariable = "KUBECONFIG"

Variables

This section is empty.

Functions

func GetDefaultRateLimiter

func GetDefaultRateLimiter() flowcontrol.RateLimiter

func GetRateLimiter

func GetRateLimiter(name string) flowcontrol.RateLimiter

func GetUnattachedRateLimiter

func GetUnattachedRateLimiter() flowcontrol.RateLimiter

func SetDefaultBurst

func SetDefaultBurst(q int)

func SetDefaultQPS

func SetDefaultQPS(q float32)

Types

type Client

type Client interface {
	Kubernetes() kubernetes.Interface
	KubernetesExtensions() apiextensionsclient.Interface
	Arango() versioned.Interface
	Monitoring() monitoring.Interface

	Name() string

	Config() *rest.Config
}

func NewClient

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

func NewFakeClient

func NewFakeClient() Client

func NewFakeClientWithVersion

func NewFakeClientWithVersion(version *version.Info) Client

func NewStaticClient

func NewStaticClient(kubernetes kubernetes.Interface, kubernetesExtensions apiextensionsclient.Interface, arango versioned.Interface, monitoring monitoring.Interface) Client

type ConfigGetter

type ConfigGetter func() (*rest.Config, string, error)

func NewStaticConfigGetter

func NewStaticConfigGetter(f func() (*rest.Config, error)) ConfigGetter

type Factory

type Factory interface {
	SetKubeConfigGetter(getter ConfigGetter)
	Refresh() error
	SetClient(c Client)

	Name() string

	Client() (Client, bool)
}

func GetDefaultFactory

func GetDefaultFactory() Factory

func GetFactory

func GetFactory(name string) Factory

func GetUnattachedFactory

func GetUnattachedFactory() Factory

type FakeClientBuilder

type FakeClientBuilder interface {
	Add(objects ...runtime.Object) FakeClientBuilder

	Version(version *version.Info) FakeClientBuilder

	Client() Client
}

func NewFakeClientBuilder

func NewFakeClientBuilder() FakeClientBuilder

type FakeDataInput

type FakeDataInput struct {
	Namespace string

	Pods            map[string]*core.Pod
	Secrets         map[string]*core.Secret
	Services        map[string]*core.Service
	PVCS            map[string]*core.PersistentVolumeClaim
	ServiceAccounts map[string]*core.ServiceAccount
	PDBSV1          map[string]*policy.PodDisruptionBudget
	ServiceMonitors map[string]*monitoring.ServiceMonitor
	ArangoMembers   map[string]*api.ArangoMember
	Nodes           map[string]*core.Node
	ACS             map[string]*api.ArangoClusterSynchronization
	AT              map[string]*api.ArangoTask
}

func (FakeDataInput) Client

func (f FakeDataInput) Client() Client

type ModInterface

type ModInterface interface {
	Secrets() generic.ModClient[*core.Secret]
	Pods() generic.ModClient[*core.Pod]
	Services() generic.ModClient[*core.Service]
	ServiceAccounts() generic.ModClient[*core.ServiceAccount]
	PersistentVolumeClaims() generic.ModClient[*core.PersistentVolumeClaim]
	PodDisruptionBudgets() generic.ModClient[*policy.PodDisruptionBudget]
	ServiceMonitors() generic.ModClient[*monitoring.ServiceMonitor]
	ArangoMembers() generic.ModStatusClient[*api.ArangoMember]
}

func NewModInterface

func NewModInterface(client Client, namespace string) ModInterface

type RESTClientGetter

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

RESTClientGetter defines the values of a helm REST client.

func NewRESTClientGetter

func NewRESTClientGetter(namespace string, kubeConfig []byte, restConfig *rest.Config, opts ...RESTClientOption) *RESTClientGetter

NewRESTClientGetter returns a RESTClientGetter using the provided 'namespace', 'kubeConfig' and 'restConfig'.

source: https://github.com/helm/helm/issues/6910#issuecomment-601277026

func (*RESTClientGetter) ToDiscoveryClient

func (c *RESTClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)

ToDiscoveryClient returns a CachedDiscoveryInterface that can be used as a discovery client.

func (*RESTClientGetter) ToRESTConfig

func (c *RESTClientGetter) ToRESTConfig() (*rest.Config, error)

ToRESTConfig returns a REST config build from a given kubeconfig

func (*RESTClientGetter) ToRESTMapper

func (c *RESTClientGetter) ToRESTMapper() (meta.RESTMapper, error)

func (*RESTClientGetter) ToRawKubeConfigLoader

func (c *RESTClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig

type RESTClientOption

type RESTClientOption func(*rest.Config)

RESTClientOption is a function that can be used to set the RESTClientOptions of a HelmClient.

func Burst

func Burst(v int) RESTClientOption

Maximum burst for throttle the created RESTClient will use DefaultBurst: 100.

func Timeout

func Timeout(d time.Duration) RESTClientOption

Timeout specifies the timeout for a RESTClient as a RESTClientOption. The default (if unspecified) is 32 seconds. See [1] for reference. [^1]: https://github.com/kubernetes/client-go/blob/c6bd30b9ec5f668df191bc268c6f550c37726edb/discovery/discovery_client.go#L52

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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