steps

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
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

func AddFinalizerFn(obj client.Object, finalizer string) func(ctx context.Context) error

AddFinalizerFn returns a func that immediately updates the instance with the given finalizer.

func DeleteConnectionSecretFn

func DeleteConnectionSecretFn() func(ctx context.Context) error

DeleteConnectionSecretFn deletes the connection secret of the PostgreSQL instance. Ignores "not found" error.

func DeleteHelmReleaseFn

func DeleteHelmReleaseFn() func(ctx context.Context) error

DeleteHelmReleaseFn removes the Helm Release from the cluster. Ignores "not found" error and returns nil if deployment namespace is unknown.

func DeleteK8upScheduleFn

func DeleteK8upScheduleFn() func(ctx context.Context) error

DeleteK8upScheduleFn deletes the K8up schedule associated to the instance. If the resource doesn't exist, it returns nil (no-op).

func DeleteNamespaceFn

func DeleteNamespaceFn() func(ctx context.Context) error

DeleteNamespaceFn deletes the namespace where the instance is deployed. Ignore "not found" error and returns nil if deployment namespace is unknown.

func DeletePvcFn

func DeletePvcFn() func(ctx context.Context) error

DeletePvcFn deletes the corev1.PersistentVolumeClaim from the deployment namespace. Ignore "not found" error and returns nil if deployment namespace is unknown.

func EnrichStatusWithHelmChartMetaFn

func EnrichStatusWithHelmChartMetaFn() func(ctx context.Context) error

EnrichStatusWithHelmChartMetaFn returns a function that updates the instance's status with metadata.

func EnsureConnectionSecretFn

func EnsureConnectionSecretFn(labelSet labels.Set) func(ctx context.Context) error

EnsureConnectionSecretFn creates the connection secret in the instance's namespace.

func EnsureCredentialsSecretFn

func EnsureCredentialsSecretFn(labelSet labels.Set) func(ctx context.Context) error

EnsureCredentialsSecretFn creates the secret that contains the PostgreSQL secret. Passwords are generated if they are unset.

func EnsureHelmReleaseFn

func EnsureHelmReleaseFn(labelSet labels.Set) func(ctx context.Context) error

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

func EnsureK8upScheduleFn(labelSet labels.Set) func(ctx context.Context) error

EnsureK8upScheduleFn creates the K8up schedule object.

func EnsureNamespace

func EnsureNamespace(name string, labelSet labels.Set) func(ctx context.Context) error

EnsureNamespace creates the namespace with given name and labels.

func EnsurePvcFn

func EnsurePvcFn(labelSet labels.Set) func(ctx context.Context) error

EnsurePvcFn ensures that the PVC is created.

func EnsureResticRepositorySecretFn

func EnsureResticRepositorySecretFn(labelSet labels.Set) func(ctx context.Context) error

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

func FetchNamespaceFn(namespaceName string, contextKey any) func(ctx context.Context) error

FetchNamespaceFn fetches the namespace of the given name and stores it in the context with given key.

func FetchOperatorConfigFn

func FetchOperatorConfigFn(operatorNamespace string) func(ctx context.Context) error

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

func FetchS3BucketSecretFn() func(ctx context.Context) error

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

func FetchServiceFn() func(ctx context.Context) error

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

func GetClientFromContext(ctx context.Context) client.Client

GetClientFromContext returns the client from the context.

func GetConfigFromContext

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

func IsBackupEnabledP() pipeline.Predicate

IsBackupEnabledP returns a predicate that returns true if backups are enabled in the spec.

func IsHelmReleaseReadyP

func IsHelmReleaseReadyP() func(ctx context.Context) bool

IsHelmReleaseReadyP returns a predicate that returns true if the HelmRelease has the ready condition.

func MarkInstanceAsProgressingFn

func MarkInstanceAsProgressingFn() func(ctx context.Context) error

MarkInstanceAsProgressingFn marks an instance as progressing by updating the status conditions.

func MarkInstanceAsReadyFn

func MarkInstanceAsReadyFn() func(ctx context.Context) error

MarkInstanceAsReadyFn marks an instance as ready by updating the status conditions.

func RemoveFinalizerFn

func RemoveFinalizerFn(finalizer string) func(ctx context.Context) error

RemoveFinalizerFn removes the finalizer from the PostgresqlStandalone instance and updates it if there was a finalizer present.

func SetClientInContext

func SetClientInContext(ctx context.Context, c client.Client)

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 ClientKey

type ClientKey struct{}

ClientKey identifies the Kubernetes client 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.

Jump to

Keyboard shortcuts

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