cmd

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAllFlags

func AddAllFlags(fs *pflag.FlagSet, f ...Flagger)

AddAllFlags adds all Flaggers to the given FlagSet.

func AddAllToManager

func AddAllToManager(mgr manager.Manager, all ...AddToMangerFunc) error

AddAllToManager calls all AddToManagerFuncs.

func CompleteAll

func CompleteAll(c ...Completer) error

CompleteAll completes all Completers.

Types

type AddToMangerFunc

type AddToMangerFunc func(manager.Manager) error

AddToMangerFunc is a function which will add a controller or something similar to a Manager.

type Completer

type Completer interface {
	Complete() error
}

Completer can complete some configuration options.

type Flagger

type Flagger interface {
	AddFlags(*pflag.FlagSet)
}

Flagger can add needed flags to a FlagSet.

type ManagerConfig

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

ManagerConfig contains the completed general manager configuration which can be applied to manager.Options via Apply.

func (*ManagerConfig) Apply

func (c *ManagerConfig) Apply(opts *manager.Options)

Apply sets the values of this ManagerConfig on the given manager.Options.

type ManagerOptions

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

ManagerOptions contains options needed to construct the controller-runtime manager.

func (*ManagerOptions) AddFlags

func (o *ManagerOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds the needed command line flags to the given FlagSet.

func (*ManagerOptions) Complete

func (o *ManagerOptions) Complete() error

Complete builds the manager.Options based on the given flag values.

func (*ManagerOptions) Completed

func (o *ManagerOptions) Completed() *ManagerConfig

Completed returns the constructed ManagerConfig.

type Option

type Option interface {
	Flagger
	Completer
}

Option is a compound interface type for an option for the resource-manager.

type SourceClientConfig

type SourceClientConfig struct {
	RESTConfig        *rest.Config
	CacheResyncPeriod *time.Duration
	ClientSet         *kubernetes.Clientset
	Scheme            *runtime.Scheme
	Namespace         string
}

SourceClientConfig contains the constructed source clients including a kubernetes ClientSet and Scheme.

func (*SourceClientConfig) ApplyClientSet

func (c *SourceClientConfig) ApplyClientSet(clientSet *kubernetes.Clientset)

ApplyClientSet sets clientSet to the ClientSet of this config.

func (*SourceClientConfig) ApplyManagerOptions

func (c *SourceClientConfig) ApplyManagerOptions(opts *manager.Options)

ApplyManagerOptions sets the values of this SourceClientConfig on the given manager.Options.

type SourceClientOptions

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

SourceClientOptions contains options needed to construct the source client.

func (*SourceClientOptions) AddFlags

func (o *SourceClientOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds the needed command line flags to the given FlagSet.

func (*SourceClientOptions) Complete

func (o *SourceClientOptions) Complete() error

Complete builds the source client based on the given flag values and saves it for retrieval via Completed.

func (*SourceClientOptions) Completed

func (o *SourceClientOptions) Completed() *SourceClientConfig

Completed returns the constructed source clients including a kubernetes ClientSet and Scheme.

type TargetClientConfig

type TargetClientConfig struct {
	Client     client.Client
	RESTMapper meta.RESTMapper
	Scheme     *runtime.Scheme
	// contains filtered or unexported fields
}

TargetClientConfig contains the constructed target clients including a RESTMapper and Scheme. Before the first usage, Start and WaitForCacheSync should be called to ensure that the cache is running and has been populated successfully.

func NewTargetClientConfig added in v0.25.0

func NewTargetClientConfig(kubeconfigPath string, disableCache bool, cacheResyncPeriod time.Duration) (*TargetClientConfig, error)

NewTargetClientConfig creates a new target client config.

func (*TargetClientConfig) Apply

func (c *TargetClientConfig) Apply(conf *TargetClientConfig)

Apply sets the values of this TargetClientConfig on the given config.

func (*TargetClientConfig) Start

func (c *TargetClientConfig) Start(ctx context.Context) error

Start starts the target cache if the client is cached.

func (*TargetClientConfig) WaitForCacheSync

func (c *TargetClientConfig) WaitForCacheSync(ctx context.Context) bool

WaitForCacheSync waits for the caches of the target cache to be synced initially.

type TargetClientOptions

type TargetClientOptions struct {
	KubeconfigPath    string
	DisableCache      bool
	CacheResyncPeriod time.Duration
	// contains filtered or unexported fields
}

TargetClientOptions contains options needed to construct the target client.

func (*TargetClientOptions) AddFlags

func (o *TargetClientOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds the needed command line flags to the given FlagSet.

func (*TargetClientOptions) Complete

func (o *TargetClientOptions) Complete() error

Complete builds the target client based on the given flag values and saves it for retrieval via Completed.

func (*TargetClientOptions) Completed

func (o *TargetClientOptions) Completed() *TargetClientConfig

Completed returns the constructed target clients including a RESTMapper and Scheme. Before the first usage, Start and WaitForCacheSync should be called to ensure that the cache is running and has been populated successfully.

Jump to

Keyboard shortcuts

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