Documentation
¶
Index ¶
- type ConnectionKind
- type KubernetesClientProvider
- func (k *KubernetesClientProvider) ClientGoClient() (kubernetes.Interface, error)
- func (k *KubernetesClientProvider) Config() *rest.Config
- func (k *KubernetesClientProvider) DiscoveryClient() (discovery.DiscoveryInterface, error)
- func (k *KubernetesClientProvider) DynamicClient() (dynamic.Interface, error)
- func (k *KubernetesClientProvider) RuntimeClient() (runtimeclient.Client, error)
- func (k *KubernetesClientProvider) SetClientGoClient(client kubernetes.Interface)
- func (k *KubernetesClientProvider) SetDiscoveryClient(client discovery.DiscoveryInterface)
- func (k *KubernetesClientProvider) SetDynamicClient(client dynamic.Interface)
- func (k *KubernetesClientProvider) SetRuntimeClient(client runtimeclient.Client)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionKind ¶
type ConnectionKind string
ConnectionKind is the kind of connection to use for accessing Kubernetes.
const ( // Kind KindDefault ConnectionKind = "default" KindNone ConnectionKind = "none" )
type KubernetesClientProvider ¶
type KubernetesClientProvider struct {
// contains filtered or unexported fields
}
KubernetesClientProvider provides access to Kubernetes clients.
func FromConfig ¶
func FromConfig(config *rest.Config) *KubernetesClientProvider
FromConfig creates a new Kubernetes client provider from the given config.
For testing, pass a nil config, and then use the Set* methods to set the clients.
func FromOptions ¶
func FromOptions(options Options) (*KubernetesClientProvider, error)
FromOptions creates a new Kubernetes client provider from the given options.
func (*KubernetesClientProvider) ClientGoClient ¶
func (k *KubernetesClientProvider) ClientGoClient() (kubernetes.Interface, error)
ClientGoClient returns a Kubernetes client-go client.
func (*KubernetesClientProvider) Config ¶
func (k *KubernetesClientProvider) Config() *rest.Config
Config returns the Kubernetes client provider's config.
func (*KubernetesClientProvider) DiscoveryClient ¶
func (k *KubernetesClientProvider) DiscoveryClient() (discovery.DiscoveryInterface, error)
DiscoveryClient returns a Kubernetes discovery client.
func (*KubernetesClientProvider) DynamicClient ¶
func (k *KubernetesClientProvider) DynamicClient() (dynamic.Interface, error)
DynamicClient returns a Kubernetes dynamic client.
func (*KubernetesClientProvider) RuntimeClient ¶
func (k *KubernetesClientProvider) RuntimeClient() (runtimeclient.Client, error)
RuntimeClient returns a Kubernetes controller runtime client.
func (*KubernetesClientProvider) SetClientGoClient ¶
func (k *KubernetesClientProvider) SetClientGoClient(client kubernetes.Interface)
SetClientGoClient sets the Kubernetes client-go client. This is useful for testing.
func (*KubernetesClientProvider) SetDiscoveryClient ¶
func (k *KubernetesClientProvider) SetDiscoveryClient(client discovery.DiscoveryInterface)
SetDiscoveryClient sets the Kubernetes discovery client. This is useful for testing.
func (*KubernetesClientProvider) SetDynamicClient ¶
func (k *KubernetesClientProvider) SetDynamicClient(client dynamic.Interface)
SetDynamicClient sets the Kubernetes dynamic client. This is useful for testing.
func (*KubernetesClientProvider) SetRuntimeClient ¶
func (k *KubernetesClientProvider) SetRuntimeClient(client runtimeclient.Client)
SetRuntimeClient sets the Kubernetes controller runtime client. This is useful for testing.
type Options ¶
type Options struct { // Kind is the kind of connection to use. Kind ConnectionKind `yaml:"kind"` }
Options holds the configuration options for the Kubernetes client provider.