controller

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 28 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// KeyFunc checks for DeletedFinalStateUnknown objects before calling MetaNamespaceKeyFunc.
	KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc
)

Functions

func BoolPtr

func BoolPtr(i bool) *bool

func BuildHandlerChain

func BuildHandlerChain(apiHandler http.Handler, authorizationInfo *apiserver.AuthorizationInfo, authenticationInfo *apiserver.AuthenticationInfo, codec runtime.NegotiatedSerializer) http.Handler

BuildHandlerChain builds a handler chain with a base handler and CompletedConfig.

func CatchPanic

func CatchPanic(funcName string, addon string)

CatchPanic handles any panics that might occur during the handlePhase

func DeleteReplicaSetApp

func DeleteReplicaSetApp(ctx context.Context, kubeClient *kubernetes.Clientset, options metav1.ListOptions) error

DeleteReplicaSetApp delete the replicaset and pod additionally for deployment app with extension group

func GetAvailableResources

func GetAvailableResources(clientBuilder ClientBuilder) (map[schema.GroupVersionResource]bool, error)

GetAvailableResources needs to be exposed for the construction of a proper ControllerContext.

func Int32Ptr

func Int32Ptr(i int32) *int32

Int32Ptr translate int32 to pointer

func Int64Ptr

func Int64Ptr(i int64) *int64

func NewBaseHandler

NewBaseHandler takes in CompletedConfig and returns a handler.

func ResyncPeriod

func ResyncPeriod(cfg *options.ComponentConfiguration) func() time.Duration

ResyncPeriod returns a function which generates a duration each time it is invoked; this is so that multiple controllers don't get into lock-step and all hammer the apiserver with list requests simultaneously.

func WaitForAPIServer

func WaitForAPIServer(client versionedclientset.Interface, timeout time.Duration) error

WaitForAPIServer waits for the API Server's /healthz endpoint to report "ok" with timeout.

func WaitForCacheSync

func WaitForCacheSync(controllerName string, stopCh <-chan struct{}, cacheSyncs ...cache.InformerSynced) bool

WaitForCacheSync is a wrapper around cache.WaitForCacheSync that generates log messages indicating that the controller identified by controllerName is waiting for syncs, followed by either a successful or failed sync.

Types

type ClientBuilder

type ClientBuilder interface {
	Config(name string) (*rest.Config, error)
	ConfigOrDie(name string) *rest.Config
	Client(name string) (versionedclientset.Interface, error)
	ClientOrDie(name string) versionedclientset.Interface
	ClientGoClient(name string) (versionedclientset.Interface, error)
	ClientGoClientOrDie(name string) versionedclientset.Interface
}

ClientBuilder allows you to get clients and configs for controllers.

type SimpleControllerClientBuilder

type SimpleControllerClientBuilder struct {
	// ClientConfig is a skeleton config to clone and use as the basis for each controller client.
	ClientConfig *rest.Config
}

SimpleControllerClientBuilder returns a fixed client with different user agents.

func (SimpleControllerClientBuilder) Client

Client returns the complete client set for constructing clients.

func (SimpleControllerClientBuilder) ClientGoClient

ClientGoClient returns the complete client set for constructing clients.

func (SimpleControllerClientBuilder) ClientGoClientOrDie

ClientGoClientOrDie returns the complete client set for constructing clients.

func (SimpleControllerClientBuilder) ClientOrDie

ClientOrDie returns the complete client set for constructing clients.

func (SimpleControllerClientBuilder) Config

Config returns a complete clientConfig for constructing clients.

func (SimpleControllerClientBuilder) ConfigOrDie

func (b SimpleControllerClientBuilder) ConfigOrDie(name string) *rest.Config

ConfigOrDie returns a complete clientConfig for constructing clients.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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