Documentation
¶
Index ¶
- Constants
- Variables
- func ClusterName(envName string) string
- type CNPGDatabaseProvider
- func (p *CNPGDatabaseProvider) Provision(ctx context.Context, env *v1alpha1.Environment) (*pkgdb.DatabaseResult, error)
- func (p *CNPGDatabaseProvider) Status(ctx context.Context, env *v1alpha1.Environment) (*pkgdb.DatabaseStatus, error)
- func (p *CNPGDatabaseProvider) Teardown(ctx context.Context, env *v1alpha1.Environment) error
Constants ¶
View Source
const ( DefaultStorageSize = "1Gi" DefaultInstances = int64(1) )
Variables ¶
View Source
var ClusterGVK = schema.GroupVersionKind{
Group: "postgresql.cnpg.io",
Version: "v1",
Kind: "Cluster",
}
ClusterGVK is the GroupVersionKind for CloudNativePG Cluster resources.
Functions ¶
func ClusterName ¶
ClusterName returns a valid DNS-1123 name diverge-pg-<envName> (<= 50 chars so <clusterName>-rw fits in 63 chars).
Types ¶
type CNPGDatabaseProvider ¶
type CNPGDatabaseProvider struct {
Client client.Client
Scheme *runtime.Scheme
StorageSize string // default "1Gi"
Instances int64 // default 1
SourceCluster string // optional default source cluster for recovery/clone
SourceNamespace string // optional default namespace for source cluster
}
CNPGDatabaseProvider provisions and tears down ephemeral CloudNativePG Clusters.
func (*CNPGDatabaseProvider) Provision ¶
func (p *CNPGDatabaseProvider) Provision(ctx context.Context, env *v1alpha1.Environment) (*pkgdb.DatabaseResult, error)
Provision creates or reconciles a CloudNativePG Cluster for the preview environment.
func (*CNPGDatabaseProvider) Status ¶
func (p *CNPGDatabaseProvider) Status(ctx context.Context, env *v1alpha1.Environment) (*pkgdb.DatabaseStatus, error)
Status inspects the CNPG Cluster status phase and conditions.
func (*CNPGDatabaseProvider) Teardown ¶
func (p *CNPGDatabaseProvider) Teardown(ctx context.Context, env *v1alpha1.Environment) error
Teardown deletes the CNPG Cluster for the preview environment idempotently.
Click to show internal directories.
Click to hide internal directories.