replicator

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnnotationPrefix is the prefix for all replication annotations
	AnnotationPrefix = "iso.gtrfc.com/"

	// AnnotationReplicatableFromNamespaces allowlist of namespaces that can replicate FROM this Secret
	AnnotationReplicatableFromNamespaces = AnnotationPrefix + "replicatable-from-namespaces"

	// AnnotationReplicateFrom source Secret to replicate data from (format: "namespace/secret-name")
	AnnotationReplicateFrom = AnnotationPrefix + "replicate-from"

	// AnnotationReplicateTo push this secret to specified namespaces (comma-separated)
	AnnotationReplicateTo = AnnotationPrefix + "replicate-to"

	// AnnotationReplicatedFrom indicates this Secret was replicated from another Secret
	AnnotationReplicatedFrom = AnnotationPrefix + "replicated-from"

	// AnnotationLastReplicatedAt timestamp of last replication
	AnnotationLastReplicatedAt = AnnotationPrefix + "last-replicated-at"

	// FinalizerReplicateToCleanup finalizer for cleaning up pushed Secrets
	FinalizerReplicateToCleanup = AnnotationPrefix + "replicate-to-cleanup"
)

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(secret *corev1.Secret)

AddFinalizer adds the replication finalizer to a Secret

func CreateReplicatedSecret

func CreateReplicatedSecret(source *corev1.Secret, targetNamespace string) *corev1.Secret

CreateReplicatedSecret creates a new Secret for replication

func GetReplicatedFromAnnotation

func GetReplicatedFromAnnotation(secret *corev1.Secret) string

GetReplicatedFromAnnotation returns the value of the replicated-from annotation

func HasConflictingAnnotations

func HasConflictingAnnotations(secret *corev1.Secret) bool

HasConflictingAnnotations checks if autogenerate and replicate-from are both present

func HasFinalizer

func HasFinalizer(secret *corev1.Secret) bool

HasFinalizer checks if a Secret has the replication finalizer

func IsBeingDeleted

func IsBeingDeleted(secret *corev1.Secret) bool

IsBeingDeleted checks if a Secret is being deleted (has DeletionTimestamp)

func IsOwnedByUs

func IsOwnedByUs(secret *corev1.Secret, expectedSource string) bool

IsOwnedByUs checks if a Secret was replicated by us (has our annotation)

func MatchNamespace

func MatchNamespace(namespace, pattern string) (bool, error)

MatchNamespace checks if a namespace matches a glob pattern Supports glob patterns: *, ?, [abc], [a-z], [0-9]

func ParseSourceReference

func ParseSourceReference(sourceRef string) (namespace, name string, err error)

ParseSourceReference parses "namespace/secret-name" format

func ParseTargetNamespaces

func ParseTargetNamespaces(targetNS string) []string

ParseTargetNamespaces parses comma-separated list of target namespaces

func RemoveFinalizer

func RemoveFinalizer(secret *corev1.Secret)

RemoveFinalizer removes the replication finalizer from a Secret

func ReplicateSecret

func ReplicateSecret(source, target *corev1.Secret)

ReplicateSecret copies data from source Secret to target Secret

func ValidateReplication

func ValidateReplication(sourceNamespace string, sourceAllowlist string, targetNamespace string) (bool, error)

ValidateReplication checks if replication is allowed (mutual consent)

Types

This section is empty.

Jump to

Keyboard shortcuts

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