controller

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// syncing type annotations
	NamespaceAllAnnotationKey      = "secret.sync.klst.pw/all-namespaces"
	NamespaceSelectorAnnotationKey = "secret.sync.klst.pw/namespace-selector"

	// origin annotations (based on the idea of github.com/appscode/kubed)
	OriginNameLabelsKey      = "secret.sync.klst.pw/origin.name"
	OriginNamespaceLabelsKey = "secret.sync.klst.pw/origin.namespace"
)

Variables

This section is empty.

Functions

func SynchronizeOwnedSecret

func SynchronizeOwnedSecret(ctx *Context, secret corev1.Secret, namespace string) error

SynchronizeOwnedSecret duplicates the given secret in the given namespace.

func SynchronizeSecret

func SynchronizeSecret(ctx *Context, secret corev1.Secret) error

SynchronizeSecret duplicates the given secret on namespaces matching with its annotation.

Types

type AnnotationError

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

type ClientError

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

type Context

type Context struct {
	gocontext.Context
	IgnoredNamespaces    []string
	ProtectedLabels      []string
	ProtectedAnnotations []string
	// contains filtered or unexported fields
}

Context contains all required information used by the controller to synchronize secrets, like kubernetes client or controller configuration.

func NewContext

func NewContext(ctx gocontext.Context, client client.Client) *Context

NewContext creates a new context instance.

func NewTestContext

func NewTestContext(ctx gocontext.Context, client client.Client, registry *registry.Registry) *Context

NewTestContext creates a new context instance for testing purpose.

type Controller

type Controller struct {
	Context
	// contains filtered or unexported fields
}

func NewController

func NewController(metricsBindAddress, healthProbeBindAddress string, ctx Context) *Controller

func (*Controller) Run

func (c *Controller) Run(stop <-chan struct{})

type NamespaceReconciler

type NamespaceReconciler struct{ *Context }

func (*NamespaceReconciler) Reconcile

type NoAnnotationError

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

type OwnedSecretReconcilier

type OwnedSecretReconcilier struct{ *Context }

func (*OwnedSecretReconcilier) Reconcile

type RegistryError

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

type SecretReconciler

type SecretReconciler struct{ *Context }

func (*SecretReconciler) Reconcile

func (r *SecretReconciler) Reconcile(req reconcile.Request) (reconcile.Result, error)

Jump to

Keyboard shortcuts

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