managers

package
v2.0.0-...-0cc064c Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 23 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ProvideManagerSet is to be used by
	// wire files to get a controller manager
	ProvideManagerSet = wire.NewSet(
		wire.FieldsOf(new(*ControllerFields), "Client", "Logger", "Scheme", "Config"),
		kubernetes.NewForConfig,
		dynamic.NewForConfig,
		NewDynamicRESTMapper,
		discovery.NewDiscoveryClientForConfig,
		ProvideSimpleClient,
		wire.Bind(new(kubernetes.Interface), new(*kubernetes.Clientset)),
	)

	// ProvideConfiglessManagerSet is the same as ProvideManagerSet
	// but with no config. This allows for use of envtest
	ProvideConfiglessManagerSet = wire.NewSet(
		wire.FieldsOf(new(*ControllerFields), "Client", "Logger", "Scheme", "Config"),
		kubernetes.NewForConfig,
		NewDynamicRESTMapper,
		dynamic.NewForConfig,
		wire.Bind(new(kubernetes.Interface), new(*kubernetes.Clientset)),
	)

	// ProvideCacheClientSet is to be used by
	// wire files to get a cached client
	ProvideCachedClientSet = wire.NewSet(
		kubernetes.NewForConfig,
		ProvideCachedClient,
		ProvideNewCache,
		StartCache,
		NewDynamicRESTMapper,
		dynamic.NewForConfig,
		wire.Bind(new(kubernetes.Interface), new(*kubernetes.Clientset)),
	)

	ProvideSimpleClientSet = wire.NewSet(
		kubernetes.NewForConfig,
		ProvideSimpleClient,
		NewDynamicRESTMapper,
		dynamic.NewForConfig,
		wire.Bind(new(kubernetes.Interface), new(*kubernetes.Clientset)),
	)

	ProvideMetadataClientSet = wire.NewSet(
		kubernetes.NewForConfig,
		ProvideCachedClient,
		ProvideNewCache,
		StartCache,
		NewDynamicRESTMapper,
		metadata.NewForConfig,
		wire.Bind(new(kubernetes.Interface), new(*kubernetes.Clientset)),
	)
)

Functions

func NewDynamicRESTMapper

func NewDynamicRESTMapper(cfg *rest.Config) (meta.RESTMapper, error)

func ProvideCachedClient

func ProvideCachedClient(
	c *rest.Config,
	mapper meta.RESTMapper,
	scheme *k8sruntime.Scheme,
	inCache cache.Cache,
	options ClientOptions,
) (client.Client, error)

func ProvideManagerClient

func ProvideManagerClient(mgr manager.Manager) client.Client

func ProvideNewCache

func ProvideNewCache(
	c *rest.Config,
	mapper meta.RESTMapper,
	scheme *k8sruntime.Scheme,
	options ClientOptions,

) (cache.Cache, error)

func ProvideSimpleClient

func ProvideSimpleClient(
	c *rest.Config,
	mapper meta.RESTMapper,
	scheme *k8sruntime.Scheme,
) (rhmclient.SimpleClient, error)

Types

type CacheIsIndexed

type CacheIsIndexed struct{}

func AddIndices

func AddIndices(
	ctx context.Context,
	cache cache.Cache) (CacheIsIndexed, error)

type CacheIsStarted

type CacheIsStarted struct{}

func StartCache

func StartCache(
	ctx context.Context,
	cache cache.Cache,
	log logr.Logger,
	isIndexed CacheIsIndexed,
) (CacheIsStarted, error)

type ClientOptions

type ClientOptions struct {
	SyncPeriod   *time.Duration
	DryRunClient bool
	Namespace    string

	ByObject map[client.Object]cache.ByObject
}

type ControllerFields

type ControllerFields struct {
	Client client.Client
	Scheme *k8sruntime.Scheme
	Logger logr.Logger
	Config *rest.Config
}

type ControllerMain

type ControllerMain struct {
	Name     OperatorName
	FlagSets []*pflag.FlagSet
	Manager  manager.Manager
}

type DeployedNamespace

type DeployedNamespace string

type OperatorName

type OperatorName string

type WatchedNamespace

type WatchedNamespace string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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