Documentation
¶
Index ¶
- Constants
- func AddFinalizer(secret *corev1.Secret)
- func CreateReplicatedSecret(source *corev1.Secret, targetNamespace string) *corev1.Secret
- func GetReplicatedFromAnnotation(secret *corev1.Secret) string
- func HasConflictingAnnotations(secret *corev1.Secret) bool
- func HasFinalizer(secret *corev1.Secret) bool
- func IsBeingDeleted(secret *corev1.Secret) bool
- func IsOwnedByUs(secret *corev1.Secret, expectedSource string) bool
- func MatchNamespace(namespace, pattern string) (bool, error)
- func ParseSourceReference(sourceRef string) (namespace, name string, err error)
- func ParseTargetNamespaces(targetNS string) []string
- func RemoveFinalizer(secret *corev1.Secret)
- func ReplicateSecret(source, target *corev1.Secret)
- func ValidateReplication(sourceNamespace string, sourceAllowlist string, targetNamespace string) (bool, error)
Constants ¶
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 ¶
AddFinalizer adds the replication finalizer to a Secret
func CreateReplicatedSecret ¶
CreateReplicatedSecret creates a new Secret for replication
func GetReplicatedFromAnnotation ¶
GetReplicatedFromAnnotation returns the value of the replicated-from annotation
func HasConflictingAnnotations ¶
HasConflictingAnnotations checks if autogenerate and replicate-from are both present
func HasFinalizer ¶
HasFinalizer checks if a Secret has the replication finalizer
func IsBeingDeleted ¶
IsBeingDeleted checks if a Secret is being deleted (has DeletionTimestamp)
func IsOwnedByUs ¶
IsOwnedByUs checks if a Secret was replicated by us (has our annotation)
func MatchNamespace ¶
MatchNamespace checks if a namespace matches a glob pattern Supports glob patterns: *, ?, [abc], [a-z], [0-9]
func ParseSourceReference ¶
ParseSourceReference parses "namespace/secret-name" format
func ParseTargetNamespaces ¶
ParseTargetNamespaces parses comma-separated list of target namespaces
func RemoveFinalizer ¶
RemoveFinalizer removes the replication finalizer from a Secret
func ReplicateSecret ¶
ReplicateSecret copies data from source Secret to target Secret
Types ¶
This section is empty.