fake

package
v0.0.0-...-73e19b3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCaCert

func NewCaCert() (*gardensecrets.Certificate, error)

func NewCertConfig

func NewCertConfig(name string, clientCert []byte) *clientcmdapi.Config

func NewClientCert

func NewClientCert(caCert *gardensecrets.Certificate, commonName string, organization []string) (*gardensecrets.Certificate, error)

func NewClientWithObjects

func NewClientWithObjects(objs ...client.Object) client.Client

func NewConfigData

func NewConfigData(name string) ([]byte, error)

NewConfigData generates a Kubernetes client configuration as a byte slice.

func NewTokenConfig

func NewTokenConfig(name string) *clientcmdapi.Config

NewTokenConfig generates a new Kubernetes client configuration with token authentication info.

func Wrap

func Wrap(client client.Client) client.Client

Types

type Factory

type Factory struct {
	// ContextImpl is the root context any command should use.
	ContextImpl context.Context

	// Either set a specific Manager instance, or overwrite the
	// individual providers/caches down below.
	ManagerImpl target.Manager

	// Override these to customize the created manager.
	Config             *config.Config
	ClientProviderImpl internalclient.Provider
	TargetProviderImpl target.TargetProvider
	TargetFlagsImpl    target.TargetFlags

	// Override the clock implementation. Will use a real clock if not set.
	ClockImpl util.Clock

	// GardenHomeDirectory is the home directory for all gardenctl
	// related files. While some files can be explicitly loaded from
	// different locations, persistent cache files will always be placed
	// inside the garden home.
	GardenHomeDirectory string

	// GardenTempDirectory is the base directory for temporary data.
	GardenTempDirectory string
}

Factory implements util.Factory interface.

func NewFakeFactory

func NewFakeFactory(cfg *config.Config, clock util.Clock, clientProvider internalclient.Provider, targetProvider target.TargetProvider) *Factory

func (*Factory) Clock

func (f *Factory) Clock() util.Clock

func (*Factory) Context

func (f *Factory) Context() context.Context

func (*Factory) GardenHomeDir

func (f *Factory) GardenHomeDir() string

func (*Factory) GardenTempDir

func (f *Factory) GardenTempDir() string

func (*Factory) Manager

func (f *Factory) Manager() (target.Manager, error)

func (*Factory) PublicIPs

func (f *Factory) PublicIPs(_ context.Context) ([]string, error)

func (*Factory) TargetFlags

func (f *Factory) TargetFlags() target.TargetFlags

type TargetProvider

type TargetProvider struct {
	Target target.Target
}

func NewFakeTargetProvider

func NewFakeTargetProvider(t target.Target) *TargetProvider

NewFakeTargetProvider returns a new TargetProvider that reads and writes from memory.

func (*TargetProvider) Read

func (p *TargetProvider) Read() (target.Target, error)

Read returns the current target.

func (*TargetProvider) Write

func (p *TargetProvider) Write(t target.Target) error

Write takes a target and saves it permanently.

Jump to

Keyboard shortcuts

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