controllers

package
v1.111.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CustomizationCRsToWatch contains all the customization CRs to watch
	CustomizationCRsToWatch = []schema.GroupVersionResource{
		corekcck8s.ToGVR(customizev1beta1.ControllerResourceGroupVersionKind),
		corekcck8s.ToGVR(customizev1beta1.ValidatingWebhookConfigurationCustomizationGroupVersionKind),
		corekcck8s.ToGVR(customizev1beta1.MutatingWebhookConfigurationCustomizationGroupVersionKind),
	}
	// NamespacedCustomizationCRsToWatch contains all the namspaced customization CRs to watch
	NamespacedCustomizationCRsToWatch = []schema.GroupVersionResource{
		corekcck8s.ToGVR(customizev1beta1.NamespacedControllerResourceGroupVersionKind),
	}
)
View Source
var (
	ValidConfigConnectorNamespacedName = types.NamespacedName{Name: k8s.ConfigConnectorAllowedName}
)

Functions

func AnnotateServiceAccountObject

func AnnotateServiceAccountObject(object *manifest.Object, gsa string) (*manifest.Object, error)

func ApplyContainerResourceCustomization added in v1.106.0

func ApplyContainerResourceCustomization(isNamespaced bool, m *manifest.Objects, controllerName string, controllerGVK schema.GroupVersionKind, containers []customizev1beta1.ContainerResourceSpec, replicas *int64) error

ApplyContainerResourceCustomization applies container resource customizations specified in ControllerResource / NamespacedControllerResource CR.

func DeleteObject

func DeleteObject(ctx context.Context, c client.Client, obj client.Object) error

func EnsureOperatorFinalizer

func EnsureOperatorFinalizer(o metav1.Object) (found bool)

func FindDuplicateStrings added in v1.111.0

func FindDuplicateStrings(strs []string) []string

func GetControllerResource added in v1.106.0

func GetControllerResource(ctx context.Context, c client.Client, name string) (*customizev1beta1.ControllerResource, error)

func GetMutatingWebhookConfigurationCustomization added in v1.109.0

func GetMutatingWebhookConfigurationCustomization(ctx context.Context, c client.Client, name string) (*customizev1beta1.MutatingWebhookConfigurationCustomization, error)

func GetNamespacedControllerResource added in v1.108.0

func GetNamespacedControllerResource(ctx context.Context, c client.Client, namespace, name string) (*customizev1beta1.NamespacedControllerResource, error)

func GetValidatingWebhookConfigurationCustomization added in v1.109.0

func GetValidatingWebhookConfigurationCustomization(ctx context.Context, c client.Client, name string) (*customizev1beta1.ValidatingWebhookConfigurationCustomization, error)

func IsControllerManagerService

func IsControllerManagerService(obj *manifest.Object) bool

func IsControllerManagerStatefulSet

func IsControllerManagerStatefulSet(obj *manifest.Object) bool

func ListControllerResources added in v1.106.0

func ListControllerResources(ctx context.Context, c client.Client) ([]customizev1beta1.ControllerResource, error)

ListControllerResources lists all ControllerResources.

func ListMutatingWebhookConfigurationCustomizations added in v1.109.0

func ListMutatingWebhookConfigurationCustomizations(ctx context.Context, c client.Client) ([]customizev1beta1.MutatingWebhookConfigurationCustomization, error)

ListMutatingWebhookConfigurationCustomizations lists all MutatingWebhookConfigurationCustomization CRs.

func ListNamespacedControllerResources added in v1.108.0

func ListNamespacedControllerResources(ctx context.Context, c client.Client, namespace string) ([]customizev1beta1.NamespacedControllerResource, error)

ListNamespacedControllerResources lists all NamespacedControllerResource CRs in the given namespace.

func ListValidatingWebhookConfigurationCustomizations added in v1.109.0

func ListValidatingWebhookConfigurationCustomizations(ctx context.Context, c client.Client) ([]customizev1beta1.ValidatingWebhookConfigurationCustomization, error)

ListValidatingWebhookConfigurationCustomizations lists all ValidatingWebhookConfigurationCustomization CRs.

func RemoveOperatorFinalizer

func RemoveOperatorFinalizer(o metav1.Object) (found bool)

Types

type CustomizationWatcher added in v1.106.0

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

CustomizationWatcher setup watches on 'triggerGVRs'. It is used by the CC / CCC operator.

For ConfigConnector operator, CustomizationWatcher setups a cluster-scoped watch on the customization CRs. Any changes to the customization CRs raises a watch event on the ConfigConnector object, which then triggers a reconciliation.

For ConfigConnectorContext operator, CustomizationWatcher setups a cluster-scoped watch, despite the fact that the CRs being watched are namespaced. This is to keep the number of watches low when there are large number of namespaces managed by Config Connector. Any changes to the namespaced customization CRs raises a watch event on the ConfigConnectorContext object in the same namespace.

The raised watch events are sent to "events" channel, which is watched by CC / CCC operator.

func NewWithDynamicClient added in v1.106.0

func NewWithDynamicClient(dc dynamic.Interface, opts CustomizationWatcherOptions) *CustomizationWatcher

func (*CustomizationWatcher) EnsureWatchStarted added in v1.106.0

func (w *CustomizationWatcher) EnsureWatchStarted(ctx context.Context, targetNN types.NamespacedName) error

EnsureWatchStarted starts watches on triggerGVRs if not already done so.

func (*CustomizationWatcher) Events added in v1.106.0

func (w *CustomizationWatcher) Events() chan event.GenericEvent

Events returns a channel with events raised on target.

type CustomizationWatcherOptions added in v1.108.0

type CustomizationWatcherOptions struct {
	TriggerGVRs []schema.GroupVersionResource
	Log         logr.Logger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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