controllers

package
v1.127.0 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: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ValidConfigConnectorNamespacedName = types.NamespacedName{Name: k8s.ConfigConnectorAllowedName}
)

Functions

func AnnotateServiceAccountObject

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

func ApplyContainerPprof added in v1.125.0

func ApplyContainerPprof(m *manifest.Objects, targetControllerName string, pprofConfig *customizev1beta1.PprofConfig) error

func ApplyContainerRateLimit added in v1.119.0

func ApplyContainerRateLimit(m *manifest.Objects, targetControllerName string, ratelimit *customizev1beta1.RateLimit) 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 BuildScheme added in v1.114.0

func BuildScheme() *runtime.Scheme

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 GetControllerReconciler added in v1.125.0

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

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 GetNamespacedControllerReconciler added in v1.119.0

func GetNamespacedControllerReconciler(ctx context.Context, c client.Client, namespace, name string) (*customizev1beta1.NamespacedControllerReconciler, 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 ListControllerReconcilers added in v1.125.0

func ListControllerReconcilers(ctx context.Context, c client.Client) ([]customizev1beta1.ControllerReconciler, error)

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 ListNamespacedControllerReconcilers added in v1.119.0

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

ListNamespacedControllerReconcilers lists all NamespacedControllerReconcilers CRs in the given namespace.

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
}

type ImageTransform added in v1.125.0

type ImageTransform struct {
	// ImagePrefix changes the image registry to a different registry, keeping the name.
	// We strip off all but the last component of the image name, and then add the prefix.
	// The tag is unchanged.
	//
	// gcr.io/gke-release/cnrm/deletiondefender:1.0 => ${IMAGE_PREFIX}/deletiondefender:1.0
	// deletiondefender:1.0 => ${IMAGE_PREFIX}/deletiondefender:1.0
	ImagePrefix string
}

ImageTransform remaps container images in a manifest.

func NewImageTransform added in v1.125.0

func NewImageTransform(imagePrefix string) *ImageTransform

NewImageTransform builds an ImageTransform

func (*ImageTransform) RemapImages added in v1.125.0

Remap images to the specified mirror / alternative location. This function can be used as an object transformation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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