binding

package
v0.0.0-...-fff6223 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package binding builds pgrator-owned workload binding resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigSecretName

func ConfigSecretName(binding *v1.PostgresBinding) string

ConfigSecretName returns the stable connection Secret name for a binding.

func CreateConfigSecret

func CreateConfigSecret(scheme *runtime.Scheme, b *v1.PostgresBinding, instance string, caCertificate []byte, credentials map[v1.PostgresBindingCredential]CredentialMaterial) (*corev1.Secret, error)

CreateConfigSecret creates the complete stable workload-facing snapshot for an active instance. Callers must supply only validated material.

func CreateDatabaseRole

func CreateDatabaseRole(scheme *runtime.Scheme, b *v1.PostgresBinding, instance string, credential v1.PostgresBindingCredential) (*cnpgv1.DatabaseRole, error)

func CreateEgressNetworkPolicy

func CreateEgressNetworkPolicy(scheme *runtime.Scheme, b *v1.PostgresBinding, instance string) (*networkingv1.NetworkPolicy, error)

func CreateNetworkPolicy

func CreateNetworkPolicy(scheme *runtime.Scheme, b *v1.PostgresBinding, instance string) (*networkingv1.NetworkPolicy, error)

func DatabaseRoleName

func DatabaseRoleName(b *v1.PostgresBinding, instance string, credential v1.PostgresBindingCredential) string

DatabaseRoleName is unique for a binding, credential and physical instance. The suffix leaves room for CNPG's -client-cert Secret suffix.

Types

type CredentialMaterial

type CredentialMaterial struct {
	Certificate []byte
	PrivateKey  []byte
}

CredentialMaterial is the certificate and private key CNPG issued for one binding credential.

Jump to

Keyboard shortcuts

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