Documentation ¶
Index ¶
- Constants
- func AddFinalizerFn(obj client.Object, finalizer string) func(ctx context.Context) error
- func DeleteConnectionSecretFn() func(ctx context.Context) error
- func DeleteHelmReleaseFn() func(ctx context.Context) error
- func DeleteK8upScheduleFn() func(ctx context.Context) error
- func DeleteNamespaceFn() func(ctx context.Context) error
- func DeletePvcFn() func(ctx context.Context) error
- func EnrichStatusWithHelmChartMetaFn() func(ctx context.Context) error
- func EnsureConnectionSecretFn(labelSet labels.Set) func(ctx context.Context) error
- func EnsureCredentialsSecretFn(labelSet labels.Set) func(ctx context.Context) error
- func EnsureHelmReleaseFn(labelSet labels.Set) func(ctx context.Context) error
- func EnsureK8upScheduleFn(labelSet labels.Set) func(ctx context.Context) error
- func EnsureNamespace(name string, labelSet labels.Set) func(ctx context.Context) error
- func EnsurePvcFn(labelSet labels.Set) func(ctx context.Context) error
- func EnsureResticRepositorySecretFn(labelSet labels.Set) func(ctx context.Context) error
- func FetchNamespaceFn(namespaceName string, contextKey any) func(ctx context.Context) error
- func FetchOperatorConfigFn(operatorNamespace string) func(ctx context.Context) error
- func FetchS3BucketSecretFn() func(ctx context.Context) error
- func FetchServiceFn() func(ctx context.Context) error
- func FindCrossplaneCondition(conditions []crossplanev1.Condition, conditionType crossplanev1.ConditionType) *crossplanev1.Condition
- func GetClientFromContext(ctx context.Context) client.Client
- func GetConfigFromContext(ctx context.Context) *v1alpha1.PostgresqlStandaloneOperatorConfig
- func GetInstanceFromContext(ctx context.Context) *v1alpha1.PostgresqlStandalone
- func IsBackupEnabledP() pipeline.Predicate
- func IsHelmReleaseReadyP() func(ctx context.Context) bool
- func MarkInstanceAsProgressingFn() func(ctx context.Context) error
- func MarkInstanceAsReadyFn() func(ctx context.Context) error
- func RemoveFinalizerFn(finalizer string) func(ctx context.Context) error
- func SetClientInContext(ctx context.Context, c client.Client)
- func SetInstanceInContext(ctx context.Context, obj *v1alpha1.PostgresqlStandalone)
- type BucketSecretKey
- type ClientKey
- type ConfigKey
- type ConnectionSecretKey
- type CredentialSecretKey
- type DeploymentNamespaceKey
- type HelmReleaseKey
- type InstanceKey
- type InstanceNamespaceKey
- type ServiceKey
Constants ¶
const AppuioOrganizationLabelKey = "appuio.io/organization"
AppuioOrganizationLabelKey is the label key required for setting ownership of a namespace
Variables ¶
This section is empty.
Functions ¶
func AddFinalizerFn ¶
AddFinalizerFn returns a func that immediately updates the instance with the given finalizer.
func DeleteConnectionSecretFn ¶
DeleteConnectionSecretFn deletes the connection secret of the PostgreSQL instance. Ignores "not found" error.
func DeleteHelmReleaseFn ¶
DeleteHelmReleaseFn removes the Helm Release from the cluster. Ignores "not found" error and returns nil if deployment namespace is unknown.
func DeleteK8upScheduleFn ¶
DeleteK8upScheduleFn deletes the K8up schedule associated to the instance. If the resource doesn't exist, it returns nil (no-op).
func DeleteNamespaceFn ¶
DeleteNamespaceFn deletes the namespace where the instance is deployed. Ignore "not found" error and returns nil if deployment namespace is unknown.
func DeletePvcFn ¶
DeletePvcFn deletes the corev1.PersistentVolumeClaim from the deployment namespace. Ignore "not found" error and returns nil if deployment namespace is unknown.
func EnrichStatusWithHelmChartMetaFn ¶
EnrichStatusWithHelmChartMetaFn returns a function that updates the instance's status with metadata.
func EnsureConnectionSecretFn ¶
EnsureConnectionSecretFn creates the connection secret in the instance's namespace.
func EnsureCredentialsSecretFn ¶
EnsureCredentialsSecretFn creates the secret that contains the PostgreSQL secret. Passwords are generated if they are unset.
func EnsureHelmReleaseFn ¶
EnsureHelmReleaseFn creates or updates the Helm release object. For first time installations, the Helm values are compiled based on the v1alpha1.PostgresqlStandaloneOperatorConfig HelmReleaseTemplate. For updates, the existing Helm values are merged with values that are specific to the instance. A release is considered "new" if the v1alpha1.PostgresqlStandalone's Status.HelmChart is nil.
func EnsureK8upScheduleFn ¶
EnsureK8upScheduleFn creates the K8up schedule object.
func EnsureNamespace ¶
EnsureNamespace creates the namespace with given name and labels.
func EnsurePvcFn ¶
EnsurePvcFn ensures that the PVC is created.
func EnsureResticRepositorySecretFn ¶
EnsureResticRepositorySecretFn returns a function that creates the restic repository secret required by K8up. The password is generated if it's a new resource, otherwise left unchanged.
func FetchNamespaceFn ¶ added in v0.1.1
FetchNamespaceFn fetches the namespace of the given name and stores it in the context with given key.
func FetchOperatorConfigFn ¶
FetchOperatorConfigFn fetches a matching v1alpha1.PostgresqlStandaloneOperatorConfig from the OperatorNamespace. The Major version specified in v1alpha1.PostgresqlStandalone is used to filter the correct config by the v1alpha1.PostgresqlMajorVersionLabelKey label. If there is none or multiple found, it returns an error.
func FetchS3BucketSecretFn ¶
FetchS3BucketSecretFn fetches a secret that contains the bucket configuration. It assumes that there is another provisioner that deploys S3 bucket ready for use.
func FetchServiceFn ¶
FetchServiceFn returns a function that gets the service object and puts it into the context.
func FindCrossplaneCondition ¶
func FindCrossplaneCondition(conditions []crossplanev1.Condition, conditionType crossplanev1.ConditionType) *crossplanev1.Condition
FindCrossplaneCondition finds the conditionType in conditions.
func GetClientFromContext ¶
GetClientFromContext returns the client from the context.
func GetConfigFromContext ¶
func GetConfigFromContext(ctx context.Context) *v1alpha1.PostgresqlStandaloneOperatorConfig
GetConfigFromContext returns the config from the context.
func GetInstanceFromContext ¶
func GetInstanceFromContext(ctx context.Context) *v1alpha1.PostgresqlStandalone
GetInstanceFromContext returns the instance from the context.
func IsBackupEnabledP ¶
IsBackupEnabledP returns a predicate that returns true if backups are enabled in the spec.
func IsHelmReleaseReadyP ¶
IsHelmReleaseReadyP returns a predicate that returns true if the HelmRelease has the ready condition.
func MarkInstanceAsProgressingFn ¶
MarkInstanceAsProgressingFn marks an instance as progressing by updating the status conditions.
func MarkInstanceAsReadyFn ¶
MarkInstanceAsReadyFn marks an instance as ready by updating the status conditions.
func RemoveFinalizerFn ¶
RemoveFinalizerFn removes the finalizer from the PostgresqlStandalone instance and updates it if there was a finalizer present.
func SetClientInContext ¶
SetClientInContext sets the given client in the context.
func SetInstanceInContext ¶
func SetInstanceInContext(ctx context.Context, obj *v1alpha1.PostgresqlStandalone)
SetInstanceInContext sets the given instance in the context.
Types ¶
type BucketSecretKey ¶
type BucketSecretKey struct{}
BucketSecretKey identifies the S3 bucket for Backup in the context.
type ConfigKey ¶
type ConfigKey struct{}
ConfigKey identifies the v1alpha1.PostgresqlStandaloneOperatorConfig in the context.
type ConnectionSecretKey ¶
type ConnectionSecretKey struct{}
ConnectionSecretKey identifies the connection secret in the context.
type CredentialSecretKey ¶
type CredentialSecretKey struct{}
CredentialSecretKey identifies the credential secret for PostgreSQL in the context.
type DeploymentNamespaceKey ¶
type DeploymentNamespaceKey struct{}
DeploymentNamespaceKey identifies the deployment Namespace in the context.
type HelmReleaseKey ¶
type HelmReleaseKey struct{}
HelmReleaseKey identifies the HelmRelease in the context.
type InstanceKey ¶
type InstanceKey struct{}
InstanceKey identifies the v1alpha1.PostgresqlStandalone in the context.
type InstanceNamespaceKey ¶ added in v0.1.1
type InstanceNamespaceKey struct{}
InstanceNamespaceKey identifies the namespace resource of the instance in the context.
type ServiceKey ¶
type ServiceKey struct{}
ServiceKey identifies the PostgreSQL service in the context.