backend

package
v0.0.0-...-9009645 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SyncConfigs map[string]v1alpha1.VaultSecretSync
	SyncMaps    map[TenantName]TenantSyncs
)

Functions

func AddSyncConfig

func AddSyncConfig(s v1alpha1.VaultSecretSync) error

func AnnotationOperations

func AnnotationOperations(r *VaultSecretSyncReconciler, vaultSecretSync *v1alpha1.VaultSecretSync) error

AnnotationOperations handles annotations on VaultSecretSync objects

func FromInternalName

func FromInternalName(in string) (string, string)

func GetSyncConfigByName

func GetSyncConfigByName(name string) (v1alpha1.VaultSecretSync, error)

func InitBackend

func InitBackend(ctx context.Context, params map[string]any) error

func InternalName

func InternalName(namespace, name string) string

func RemoveSyncConfig

func RemoveSyncConfig(name string) error

func SetSyncStatus

func SetSyncStatus(ctx context.Context, sc v1alpha1.VaultSecretSync, status SyncStatusString) error

func SourceTenantNamespace

func SourceTenantNamespace(sc v1alpha1.VaultSecretSync) (string, string, error)

func TenantNamespaceConfigs

func TenantNamespaceConfigs(evt event.VaultEvent) []v1alpha1.VaultSecretSync

func WriteEvent

func WriteEvent(ctx context.Context, namespace string, name string, Event string, reason string, message string) error

Types

type Backend

type Backend interface {
	Start(context.Context, map[string]any) error
	Type() BackendType
}
var (
	B             Backend
	ManualTrigger func(ctx context.Context, cfg v1alpha1.VaultSecretSync, op logical.Operation) error
)

func NewBackend

func NewBackend(t BackendType) (Backend, error)

type BackendType

type BackendType string
const (
	BackendTypeKubernetes BackendType = "kubernetes"
)

type KubernetesBackend

type KubernetesBackend struct {
	MetricsAddr             string `yaml:"metricsAddr" json:"metricsAddr"`
	EnableLeaderElection    bool   `yaml:"enableLeaderElection" json:"enableLeaderElection"`
	LeaderElectionNamespace string `yaml:"leaderElectionNamespace" json:"leaderElectionNamespace"`
	LeaderElectionID        string `yaml:"leaderElectionId" json:"leaderElectionId"`
}

func NewKubernetesBackend

func NewKubernetesBackend() *KubernetesBackend

func (*KubernetesBackend) Start

func (b *KubernetesBackend) Start(ctx context.Context, params map[string]any) error

func (*KubernetesBackend) Type

func (b *KubernetesBackend) Type() BackendType

type SyncStatusString

type SyncStatusString string
const (
	SyncStatusInit    SyncStatusString = "Initialized"
	SyncStatusSuccess SyncStatusString = "Synced"
	SyncStatusFailed  SyncStatusString = "Failed"
	SyncStatusDryRun  SyncStatusString = "DryRun"
)

type TenantName

type TenantName string

type TenantNamespace

type TenantNamespace string

type TenantSyncs

type TenantSyncs map[TenantNamespace][]v1alpha1.VaultSecretSync

type VaultSecretSyncReconciler

type VaultSecretSyncReconciler struct {
	client.Client
	APIReader client.Reader
	Scheme    *runtime.Scheme
	Recorder  record.EventRecorder
}
var (
	Scheme = runtime.NewScheme()

	Reconciler *VaultSecretSyncReconciler
)

func (*VaultSecretSyncReconciler) Reconcile

func (*VaultSecretSyncReconciler) SetupWithManager

func (r *VaultSecretSyncReconciler) SetupWithManager(mgr ctrl.Manager) error

Jump to

Keyboard shortcuts

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