Documentation
¶
Index ¶
- Constants
- type OpenSearchPreparedData
- type OpenSearchReconciler
- func (r *OpenSearchReconciler) AdditionalTypes() []client.Object
- func (r *OpenSearchReconciler) Delete(obj *v1.OpenSearch, _ OpenSearchPreparedData, ...) ([]action.Action, ctrl.Result, error)
- func (r *OpenSearchReconciler) FinalizerName() string
- func (r *OpenSearchReconciler) Name() string
- func (r *OpenSearchReconciler) New() *v1.OpenSearch
- func (r *OpenSearchReconciler) OwnedTypes() []reconciler.OwnedType
- func (r *OpenSearchReconciler) Prepare(_ context.Context, _ client.Reader, _ *v1.OpenSearch) (OpenSearchPreparedData, ctrl.Result, error)
- func (r *OpenSearchReconciler) Update(obj *v1.OpenSearch, _ OpenSearchPreparedData, _ reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
- type PostgresAccessPreparedData
- type PostgresAccessReconciler
- func (r *PostgresAccessReconciler) AdditionalTypes() []client.Object
- func (r *PostgresAccessReconciler) Delete(*v1.PostgresAccess, PostgresAccessPreparedData, reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
- func (r *PostgresAccessReconciler) Indexes() []reconciler.Index
- func (r *PostgresAccessReconciler) Name() string
- func (r *PostgresAccessReconciler) New() *v1.PostgresAccess
- func (r *PostgresAccessReconciler) OwnedTypes() []reconciler.OwnedType
- func (r *PostgresAccessReconciler) Prepare(ctx context.Context, reader client.Reader, access *v1.PostgresAccess) (PostgresAccessPreparedData, ctrl.Result, error)
- func (r *PostgresAccessReconciler) RelationshipWatches() []reconciler.RelationshipWatch
- func (r *PostgresAccessReconciler) Update(access *v1.PostgresAccess, prepared PostgresAccessPreparedData, ...) ([]action.Action, ctrl.Result, error)
- type PostgresBindingPreparedData
- type PostgresBindingReconciler
- func (r *PostgresBindingReconciler) AdditionalTypes() []client.Object
- func (r *PostgresBindingReconciler) Delete(_ *v1.PostgresBinding, _ PostgresBindingPreparedData, ...) ([]action.Action, ctrl.Result, error)
- func (r *PostgresBindingReconciler) Indexes() []reconciler.Index
- func (r *PostgresBindingReconciler) Name() string
- func (r *PostgresBindingReconciler) New() *v1.PostgresBinding
- func (r *PostgresBindingReconciler) OwnedTypes() []reconciler.OwnedType
- func (r *PostgresBindingReconciler) Prepare(ctx context.Context, reader client.Reader, obj *v1.PostgresBinding) (PostgresBindingPreparedData, ctrl.Result, error)
- func (r *PostgresBindingReconciler) RelationshipWatches() []reconciler.RelationshipWatch
- func (r *PostgresBindingReconciler) Update(obj *v1.PostgresBinding, prepared PostgresBindingPreparedData, ...) ([]action.Action, ctrl.Result, error)
- type PostgresBranchPreparedData
- type PostgresBranchReconciler
- func (r *PostgresBranchReconciler) AdditionalTypes() []client.Object
- func (r *PostgresBranchReconciler) Delete(obj *v1.PostgresBranch, prep PostgresBranchPreparedData, ...) ([]action.Action, ctrl.Result, error)
- func (r *PostgresBranchReconciler) Indexes() []reconciler.Index
- func (r *PostgresBranchReconciler) Name() string
- func (r *PostgresBranchReconciler) New() *v1.PostgresBranch
- func (r *PostgresBranchReconciler) OwnedTypes() []reconciler.OwnedType
- func (r *PostgresBranchReconciler) Prepare(ctx context.Context, reader client.Reader, obj *v1.PostgresBranch) (PostgresBranchPreparedData, ctrl.Result, error)
- func (r *PostgresBranchReconciler) RelationshipWatches() []reconciler.RelationshipWatch
- func (r *PostgresBranchReconciler) Update(obj *v1.PostgresBranch, prepared PostgresBranchPreparedData, ...) ([]action.Action, ctrl.Result, error)
- type PostgresPreparedData
- type PostgresReconciler
- func (r *PostgresReconciler) AdditionalTypes() []client.Object
- func (r *PostgresReconciler) Delete(_ *v1.Postgres, _ PostgresPreparedData, _ reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
- func (r *PostgresReconciler) MetricsLabels(obj *v1.Postgres) map[string]string
- func (r *PostgresReconciler) Name() string
- func (r *PostgresReconciler) New() *v1.Postgres
- func (r *PostgresReconciler) OwnedTypes() []reconciler.OwnedType
- func (r *PostgresReconciler) Prepare(ctx context.Context, reader client.Reader, obj *v1.Postgres) (PostgresPreparedData, ctrl.Result, error)
- func (r *PostgresReconciler) Update(obj *v1.Postgres, prepared PostgresPreparedData, ...) ([]action.Action, ctrl.Result, error)
- type ValkeyPreparedData
- type ValkeyReconciler
- func (r *ValkeyReconciler) AdditionalTypes() []client.Object
- func (r *ValkeyReconciler) Delete(obj *v1.Valkey, _ ValkeyPreparedData, relatedObjects reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
- func (r *ValkeyReconciler) FinalizerName() string
- func (r *ValkeyReconciler) Name() string
- func (r *ValkeyReconciler) New() *v1.Valkey
- func (r *ValkeyReconciler) OwnedTypes() []reconciler.OwnedType
- func (r *ValkeyReconciler) Prepare(_ context.Context, _ client.Reader, _ *v1.Valkey) (ValkeyPreparedData, ctrl.Result, error)
- func (r *ValkeyReconciler) Update(obj *v1.Valkey, _ ValkeyPreparedData, relatedObjects reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
Constants ¶
const ( // ProjectIDLabel and ProjectIDAnnotationFallback is where a team namespace // records which Google project it maps to. ProjectIDLabel = "google-cloud-project" ProjectIDAnnotationFallback = "cnrm.cloud.google.com/project-id" )
const ConditionReasonUnknown = "Unknown"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenSearchPreparedData ¶
type OpenSearchPreparedData struct{}
OpenSearchPreparedData contains data prepared during the Prepare phase
type OpenSearchReconciler ¶
type OpenSearchReconciler struct {
Aiven config.Aiven
Tenant config.Tenant
Recorder events.Recorder
Scheme *runtime.Scheme
}
OpenSearchReconciler reconciles an OpenSearch object
func (*OpenSearchReconciler) AdditionalTypes ¶
func (r *OpenSearchReconciler) AdditionalTypes() []client.Object
func (*OpenSearchReconciler) Delete ¶
func (r *OpenSearchReconciler) Delete(obj *v1.OpenSearch, _ OpenSearchPreparedData, relatedObjects reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
func (*OpenSearchReconciler) FinalizerName ¶
func (r *OpenSearchReconciler) FinalizerName() string
func (*OpenSearchReconciler) Name ¶
func (r *OpenSearchReconciler) Name() string
func (*OpenSearchReconciler) New ¶
func (r *OpenSearchReconciler) New() *v1.OpenSearch
func (*OpenSearchReconciler) OwnedTypes ¶
func (r *OpenSearchReconciler) OwnedTypes() []reconciler.OwnedType
func (*OpenSearchReconciler) Prepare ¶
func (r *OpenSearchReconciler) Prepare(_ context.Context, _ client.Reader, _ *v1.OpenSearch) (OpenSearchPreparedData, ctrl.Result, error)
func (*OpenSearchReconciler) Update ¶
func (r *OpenSearchReconciler) Update(obj *v1.OpenSearch, _ OpenSearchPreparedData, _ reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
type PostgresAccessPreparedData ¶
type PostgresAccessPreparedData struct {
Branch *v1.PostgresBranch `yaml:"branch"`
Cluster *cnpgv1.Cluster `yaml:"-"`
Password string `yaml:"-"`
Role *cnpgv1.DatabaseRole `yaml:"-"`
Token string `yaml:"-"`
TokenPersisted bool `yaml:"-"`
RelayAccess *unstructured.Unstructured `yaml:"-"`
Expired bool `yaml:"-"`
}
type PostgresAccessReconciler ¶
PostgresAccessReconciler establishes the durable database identity behind a personal access. Session credentials, privileges and transport are added by later PostgresAccess reconciliation steps.
func (*PostgresAccessReconciler) AdditionalTypes ¶
func (r *PostgresAccessReconciler) AdditionalTypes() []client.Object
func (*PostgresAccessReconciler) Delete ¶
func (r *PostgresAccessReconciler) Delete(*v1.PostgresAccess, PostgresAccessPreparedData, reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
func (*PostgresAccessReconciler) Indexes ¶
func (r *PostgresAccessReconciler) Indexes() []reconciler.Index
func (*PostgresAccessReconciler) Name ¶
func (r *PostgresAccessReconciler) Name() string
func (*PostgresAccessReconciler) New ¶
func (r *PostgresAccessReconciler) New() *v1.PostgresAccess
func (*PostgresAccessReconciler) OwnedTypes ¶
func (r *PostgresAccessReconciler) OwnedTypes() []reconciler.OwnedType
PostgresAccess owns its declarative access resources. The DatabaseRole uses Retain so CNPG preserves the PostgreSQL role and objects it owns after the access and DatabaseRole CR are deleted.
func (*PostgresAccessReconciler) Prepare ¶
func (r *PostgresAccessReconciler) Prepare(ctx context.Context, reader client.Reader, access *v1.PostgresAccess) (PostgresAccessPreparedData, ctrl.Result, error)
func (*PostgresAccessReconciler) RelationshipWatches ¶
func (r *PostgresAccessReconciler) RelationshipWatches() []reconciler.RelationshipWatch
func (*PostgresAccessReconciler) Update ¶
func (r *PostgresAccessReconciler) Update(access *v1.PostgresAccess, prepared PostgresAccessPreparedData, _ reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
type PostgresBindingPreparedData ¶
type PostgresBindingPreparedData struct {
Branch string `yaml:"branch"`
Snapshot *bindingSnapshot
}
PostgresBindingPreparedData contains the selected branch and, when all CNPG source material is present, an internally consistent credential snapshot.
type PostgresBindingReconciler ¶
PostgresBindingReconciler reconciles a nais.io/v1 PostgresBinding into a CloudNativePG DatabaseRole with an operator-issued client certificate, a connection Secret, and NetworkPolicies that open the path to the connection pooler.
func (*PostgresBindingReconciler) AdditionalTypes ¶
func (r *PostgresBindingReconciler) AdditionalTypes() []client.Object
func (*PostgresBindingReconciler) Delete ¶
func (r *PostgresBindingReconciler) Delete(_ *v1.PostgresBinding, _ PostgresBindingPreparedData, _ reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
Delete relies on ownerReference garbage collection. Everything a binding creates lives in the binding's own namespace, so there is nothing to clean up by hand.
This is destructive by design: read and readwrite DatabaseRoles carry databaseRoleReclaimPolicy: delete, so removing a binding runs DROP ROLE and revokes that workload's access immediately. That is the intent — a binding is the grant, so withdrawing it must withdraw the access.
Admin bindings retain the durable owner role when their DatabaseRole is deleted, while CloudNativePG garbage-collects the client certificate.
DROP ROLE fails if the role still owns objects. Read and readwrite roles never create objects, so this does not bite today, but a future writable role that owns tables would need ownership reassigned before its binding can be deleted.
func (*PostgresBindingReconciler) Indexes ¶
func (r *PostgresBindingReconciler) Indexes() []reconciler.Index
func (*PostgresBindingReconciler) Name ¶
func (r *PostgresBindingReconciler) Name() string
func (*PostgresBindingReconciler) New ¶
func (r *PostgresBindingReconciler) New() *v1.PostgresBinding
func (*PostgresBindingReconciler) OwnedTypes ¶
func (r *PostgresBindingReconciler) OwnedTypes() []reconciler.OwnedType
func (*PostgresBindingReconciler) Prepare ¶
func (r *PostgresBindingReconciler) Prepare(ctx context.Context, reader client.Reader, obj *v1.PostgresBinding) (PostgresBindingPreparedData, ctrl.Result, error)
Prepare verifies that the referenced Postgres exists in the same namespace.
Bindings are namespace-local by design: the namespace is the team boundary, so resolving the Postgres by name in the binding's own namespace is what enforces that a team cannot bind to another team's database.
func (*PostgresBindingReconciler) RelationshipWatches ¶
func (r *PostgresBindingReconciler) RelationshipWatches() []reconciler.RelationshipWatch
func (*PostgresBindingReconciler) Update ¶
func (r *PostgresBindingReconciler) Update(obj *v1.PostgresBinding, prepared PostgresBindingPreparedData, relatedObjects reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
type PostgresBranchPreparedData ¶
type PostgresBranchPreparedData struct {
PostgresName string `yaml:"postgresName"`
PostgresUID types.UID `yaml:"postgresUID"`
PostgresSpec v1.PostgresSpec `yaml:"postgresSpec"`
TeamGoogleProjectID string `yaml:"teamGoogleProjectID"`
ActiveBranch string `yaml:"activeBranch,omitempty"`
PostgresDeleting bool `yaml:"postgresDeleting,omitempty"`
RecoverySource *rccnpg.RecoverySource
RecoverySourceReady bool
RecoveryClusterUID types.UID `yaml:"recoveryClusterUID,omitempty"`
BlockingRecoveries []string `yaml:"blockingRecoveries,omitempty"`
}
type PostgresBranchReconciler ¶
type PostgresBranchReconciler struct {
Config *config.Config
Recorder events.Recorder
Scheme *runtime.Scheme
}
func (*PostgresBranchReconciler) AdditionalTypes ¶
func (r *PostgresBranchReconciler) AdditionalTypes() []client.Object
func (*PostgresBranchReconciler) Delete ¶
func (r *PostgresBranchReconciler) Delete(obj *v1.PostgresBranch, prep PostgresBranchPreparedData, _ reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
func (*PostgresBranchReconciler) Indexes ¶
func (r *PostgresBranchReconciler) Indexes() []reconciler.Index
func (*PostgresBranchReconciler) Name ¶
func (r *PostgresBranchReconciler) Name() string
func (*PostgresBranchReconciler) New ¶
func (r *PostgresBranchReconciler) New() *v1.PostgresBranch
func (*PostgresBranchReconciler) OwnedTypes ¶
func (r *PostgresBranchReconciler) OwnedTypes() []reconciler.OwnedType
func (*PostgresBranchReconciler) Prepare ¶
func (r *PostgresBranchReconciler) Prepare(ctx context.Context, reader client.Reader, obj *v1.PostgresBranch) (PostgresBranchPreparedData, ctrl.Result, error)
func (*PostgresBranchReconciler) RelationshipWatches ¶
func (r *PostgresBranchReconciler) RelationshipWatches() []reconciler.RelationshipWatch
func (*PostgresBranchReconciler) Update ¶
func (r *PostgresBranchReconciler) Update(obj *v1.PostgresBranch, prepared PostgresBranchPreparedData, relatedObjects reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
type PostgresPreparedData ¶
type PostgresPreparedData struct {
RequestedBranch string `yaml:"requestedBranch,omitempty"`
RequestedReady bool `yaml:"requestedReady,omitempty"`
}
PostgresPreparedData contains data prepared during the Prepare phase.
type PostgresReconciler ¶
type PostgresReconciler struct {
Config *config.Config
Recorder events.Recorder
Scheme *runtime.Scheme
}
PostgresReconciler reconciles a nais.io/v1 Postgres object into logical resources. Physical CNPG resources are owned by PostgresBranch.
func (*PostgresReconciler) AdditionalTypes ¶
func (r *PostgresReconciler) AdditionalTypes() []client.Object
func (*PostgresReconciler) Delete ¶
func (r *PostgresReconciler) Delete(_ *v1.Postgres, _ PostgresPreparedData, _ reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
func (*PostgresReconciler) MetricsLabels ¶
func (r *PostgresReconciler) MetricsLabels(obj *v1.Postgres) map[string]string
func (*PostgresReconciler) Name ¶
func (r *PostgresReconciler) Name() string
func (*PostgresReconciler) New ¶
func (r *PostgresReconciler) New() *v1.Postgres
func (*PostgresReconciler) OwnedTypes ¶
func (r *PostgresReconciler) OwnedTypes() []reconciler.OwnedType
func (*PostgresReconciler) Update ¶
func (r *PostgresReconciler) Update(obj *v1.Postgres, prepared PostgresPreparedData, relatedObjects reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
type ValkeyPreparedData ¶
type ValkeyPreparedData struct{}
ValkeyPreparedData contains data prepared during the Prepare phase
type ValkeyReconciler ¶
type ValkeyReconciler struct {
Aiven config.Aiven
Tenant config.Tenant
Recorder events.Recorder
Scheme *runtime.Scheme
}
ValkeyReconciler reconciles a Valkey object
func (*ValkeyReconciler) AdditionalTypes ¶
func (r *ValkeyReconciler) AdditionalTypes() []client.Object
func (*ValkeyReconciler) Delete ¶
func (r *ValkeyReconciler) Delete(obj *v1.Valkey, _ ValkeyPreparedData, relatedObjects reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)
func (*ValkeyReconciler) FinalizerName ¶
func (r *ValkeyReconciler) FinalizerName() string
func (*ValkeyReconciler) Name ¶
func (r *ValkeyReconciler) Name() string
func (*ValkeyReconciler) New ¶
func (r *ValkeyReconciler) New() *v1.Valkey
func (*ValkeyReconciler) OwnedTypes ¶
func (r *ValkeyReconciler) OwnedTypes() []reconciler.OwnedType
func (*ValkeyReconciler) Update ¶
func (r *ValkeyReconciler) Update(obj *v1.Valkey, _ ValkeyPreparedData, relatedObjects reconciler.RelatedObjects) ([]action.Action, ctrl.Result, error)