cluster

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package cluster provides functions to manipulate the package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsolidateImageRepoMaps

func ConsolidateImageRepoMaps(cmList *corev1.ConfigMapList) (map[string]string, error)

func InitializeOptions

func InitializeOptions(options *Options)

InitializeOptions initializes the options

Types

type Client

type Client interface {
	// ListCLIPluginResources lists CLIPlugin resources across all namespaces
	ListCLIPluginResources() ([]cliv1alpha1.CLIPlugin, error)
	// VerifyCLIPluginCRD returns true if CRD exists else return false
	VerifyCLIPluginCRD() (bool, error)
	// GetCLIPluginImageRepositoryOverride returns map of image repository override
	GetCLIPluginImageRepositoryOverride() (map[string]string, error)

	// BuildClusterQuery builds ClusterQuery with Dynamic client and Discovery client
	BuildClusterQuery() (*capdiscovery.ClusterQuery, error)
}

Client provides various aspects of interaction with a Kubernetes cluster provisioned by TKG

func NewClient

func NewClient(kubeConfigPath, contextStr string, kubeConfigBytes []byte, options Options) (Client, error)

NewClient creates new clusterclient from kubeconfig file and poller if kubeconfig path is empty it gets default path if options.poller is nil it creates default poller. You should only pass custom poller for unit testing if options.crtClientFactory is nil it creates default CrtClientFactory

type ClusterClientFactory

type ClusterClientFactory interface {
	NewClient(kubeConfigPath, contextStr string, kubeConfigBytes []byte, options Options) (Client, error)
}

ClusterClientFactory a factory for creating cluster clients

func NewClusterClientFactory

func NewClusterClientFactory() ClusterClientFactory

NewClusterClientFactory creates new clusterclient factory

type CrtClient

type CrtClient interface {
	NewClient(config *rest.Config, options crtclient.Options) (crtclient.Client, error)
	ListObjects(ctx context.Context, cliPlugins crtclient.ObjectList, listOptions *crtclient.ListOptions) error
}

CrtClient clientset interface

type CrtClientImpl

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

func (*CrtClientImpl) ListObjects

func (c *CrtClientImpl) ListObjects(ctx context.Context, cliPlugins crtclient.ObjectList, listOptions *crtclient.ListOptions) error

func (*CrtClientImpl) NewClient

func (c *CrtClientImpl) NewClient(config *rest.Config, options crtclient.Options) (crtclient.Client, error)

type DiscoveryClient

type DiscoveryClient interface {
	discovery.DiscoveryInterface
}

DiscoveryClient discovery client interface

type DiscoveryClientFactory

type DiscoveryClientFactory interface {
	NewDiscoveryClientForConfig(config *rest.Config) (discovery.DiscoveryInterface, error)
	ServerVersion(discoveryClient discovery.DiscoveryInterface) (*version.Info, error)
}

DiscoveryClientFactory is a interface to create discovery client

func NewDiscoveryClientFactory

func NewDiscoveryClientFactory() DiscoveryClientFactory

type DynamicClient

type DynamicClient interface {
	dynamic.Interface
}

type DynamicClientFactory

type DynamicClientFactory interface {
	NewDynamicClientForConfig(config *rest.Config) (dynamic.Interface, error)
}

DynamicClientFactory is a interface to create adynamic client

type Options

type Options struct {
	CrtClient              CrtClient
	DiscoveryClientFactory DiscoveryClientFactory
	DynamicClientFactory   DynamicClientFactory
	RequestTimeout         time.Duration
}

Options provides way to customize creation of clusterClient

func NewOptions

func NewOptions(crtClient CrtClient, discoveryClientFactory DiscoveryClientFactory, dynamicClientFactory DynamicClientFactory) Options

NewOptions returns new options

Jump to

Keyboard shortcuts

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