Documentation ¶
Overview ¶
Package v1 contains API Schema definitions for the dbo v1 API group +kubebuilder:object:generate=true +groupName=dbo.dosquad.github.io
Index ¶
- Constants
- Variables
- type DatabaseAccount
- func (in *DatabaseAccount) DeepCopy() *DatabaseAccount
- func (in *DatabaseAccount) DeepCopyInto(out *DatabaseAccount)
- func (in *DatabaseAccount) DeepCopyObject() runtime.Object
- func (d *DatabaseAccount) GetDatabaseName() (string, error)
- func (d *DatabaseAccount) GetReference() *metav1.OwnerReference
- func (d *DatabaseAccount) GetSecretName() types.NamespacedName
- func (d *DatabaseAccount) GetSpecCreateRelay() bool
- func (d *DatabaseAccount) GetSpecOnDelete() DatabaseAccountOnDelete
- func (d *DatabaseAccount) GetStatefulSetName() types.NamespacedName
- func (d *DatabaseAccount) SetStage(ctx context.Context, r client.StatusClient, stage DatabaseAccountCreateStage) error
- func (d *DatabaseAccount) Update(ctx context.Context, r client.Writer) error
- func (d *DatabaseAccount) UpdateStatus(ctx context.Context, r client.StatusClient) error
- type DatabaseAccountControllerConfig
- func (in *DatabaseAccountControllerConfig) DeepCopy() *DatabaseAccountControllerConfig
- func (in *DatabaseAccountControllerConfig) DeepCopyInto(out *DatabaseAccountControllerConfig)
- func (in *DatabaseAccountControllerConfig) DeepCopyObject() runtime.Object
- func (d *DatabaseAccountControllerConfig) GetDSNHost() string
- func (d *DatabaseAccountControllerConfig) GetRelayImage() string
- type DatabaseAccountControllerConfigDebug
- type DatabaseAccountControllerConfigList
- type DatabaseAccountCreateStage
- type DatabaseAccountList
- type DatabaseAccountOnDelete
- type DatabaseAccountSpec
- type DatabaseAccountSpecSecretTemplate
- type DatabaseAccountStatus
- type PostgreSQLDSN
- type PostgreSQLResourceName
Constants ¶
const ( // KindDatabaseAccount is the kind of DatabaseAccount. KindDatabaseAccount = "DatabaseAccount" // DefaultRelayImage is the default image used for the relay. DefaultRelayImage = "edoburu/pgbouncer:1.20.1-p0" )
Variables ¶
var ( // GroupVersion is group version used to register these objects. // //nolint:gochecknoglobals // struct as constant. GroupVersion = schema.GroupVersion{Group: "dbo.dosquad.github.io", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme. // //nolint:gochecknoglobals // struct as constant. SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. // //nolint:gochecknoglobals // struct as constant. AddToScheme = SchemeBuilder.AddToScheme )
var (
ErrMissingDatabaseUsername = errors.New("missing database username")
)
Functions ¶
This section is empty.
Types ¶
type DatabaseAccount ¶
type DatabaseAccount struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec DatabaseAccountSpec `json:"spec,omitempty"` Status DatabaseAccountStatus `json:"status,omitempty"` }
DatabaseAccount is the Schema for the databaseaccounts API.
func (*DatabaseAccount) DeepCopy ¶
func (in *DatabaseAccount) DeepCopy() *DatabaseAccount
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccount.
func (*DatabaseAccount) DeepCopyInto ¶
func (in *DatabaseAccount) DeepCopyInto(out *DatabaseAccount)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DatabaseAccount) DeepCopyObject ¶
func (in *DatabaseAccount) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*DatabaseAccount) GetDatabaseName ¶
func (d *DatabaseAccount) GetDatabaseName() (string, error)
func (*DatabaseAccount) GetReference ¶
func (d *DatabaseAccount) GetReference() *metav1.OwnerReference
func (*DatabaseAccount) GetSecretName ¶
func (d *DatabaseAccount) GetSecretName() types.NamespacedName
func (*DatabaseAccount) GetSpecCreateRelay ¶
func (d *DatabaseAccount) GetSpecCreateRelay() bool
func (*DatabaseAccount) GetSpecOnDelete ¶
func (d *DatabaseAccount) GetSpecOnDelete() DatabaseAccountOnDelete
func (*DatabaseAccount) GetStatefulSetName ¶
func (d *DatabaseAccount) GetStatefulSetName() types.NamespacedName
func (*DatabaseAccount) SetStage ¶
func (d *DatabaseAccount) SetStage(ctx context.Context, r client.StatusClient, stage DatabaseAccountCreateStage) error
func (*DatabaseAccount) UpdateStatus ¶
func (d *DatabaseAccount) UpdateStatus(ctx context.Context, r client.StatusClient) error
type DatabaseAccountControllerConfig ¶
type DatabaseAccountControllerConfig struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // ControllerManagerConfigurationSpec returns the contfigurations for controllers cfg.ControllerManagerConfigurationSpec `json:",inline"` Debug DatabaseAccountControllerConfigDebug `json:"debug,omitempty"` // DatabaseDSN is the DSN for the database that will be used for creating accounts and databases on. DatabaseDSN PostgreSQLDSN `json:"dsn,omitempty"` // RelayImage is the image used for the relay pod. //+optional // +kubebuilder:default:="edoburu/pgbouncer:1.20.1-p0" RelayImage string `json:"relayImage,omitempty"` }
DatabaseAccountControllerConfig is the Schema for the databaseaccountcontrollerconfigs API.
+kubebuilder:object:root=true
func (*DatabaseAccountControllerConfig) DeepCopy ¶
func (in *DatabaseAccountControllerConfig) DeepCopy() *DatabaseAccountControllerConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountControllerConfig.
func (*DatabaseAccountControllerConfig) DeepCopyInto ¶
func (in *DatabaseAccountControllerConfig) DeepCopyInto(out *DatabaseAccountControllerConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DatabaseAccountControllerConfig) DeepCopyObject ¶
func (in *DatabaseAccountControllerConfig) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*DatabaseAccountControllerConfig) GetDSNHost ¶
func (d *DatabaseAccountControllerConfig) GetDSNHost() string
func (*DatabaseAccountControllerConfig) GetRelayImage ¶
func (d *DatabaseAccountControllerConfig) GetRelayImage() string
type DatabaseAccountControllerConfigDebug ¶
type DatabaseAccountControllerConfigDebug struct {
ReconcileSleep int `json:"reconcileSleep,omitempty"`
}
func (*DatabaseAccountControllerConfigDebug) DeepCopy ¶
func (in *DatabaseAccountControllerConfigDebug) DeepCopy() *DatabaseAccountControllerConfigDebug
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountControllerConfigDebug.
func (*DatabaseAccountControllerConfigDebug) DeepCopyInto ¶
func (in *DatabaseAccountControllerConfigDebug) DeepCopyInto(out *DatabaseAccountControllerConfigDebug)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseAccountControllerConfigList ¶
type DatabaseAccountControllerConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []DatabaseAccountControllerConfig `json:"items"` }
DatabaseAccountControllerConfigList contains a list of DatabaseAccountControllerConfig.
+kubebuilder:object:root=true
func (*DatabaseAccountControllerConfigList) DeepCopy ¶
func (in *DatabaseAccountControllerConfigList) DeepCopy() *DatabaseAccountControllerConfigList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountControllerConfigList.
func (*DatabaseAccountControllerConfigList) DeepCopyInto ¶
func (in *DatabaseAccountControllerConfigList) DeepCopyInto(out *DatabaseAccountControllerConfigList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DatabaseAccountControllerConfigList) DeepCopyObject ¶
func (in *DatabaseAccountControllerConfigList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DatabaseAccountCreateStage ¶
type DatabaseAccountCreateStage string
DatabaseAccountCreateStage is the stage the account creation is up to. +kubebuilder:validation:Enum=Init;UserCreate;DatabaseCreate;RelayCreate;Error;Ready;Terminating
const ( // UnknownStage is the first stage of creating the account. UnknownStage DatabaseAccountCreateStage = "" // InitStage is the first stage of creating the account. InitStage DatabaseAccountCreateStage = "Init" // UserCreateStage is the step where the account creation has been started. UserCreateStage DatabaseAccountCreateStage = "UserCreate" // DatabaseCreateStage is the step where the account creation has been started. DatabaseCreateStage DatabaseAccountCreateStage = "DatabaseCreate" // RelayCreateStage is the step where the account creation has been started. RelayCreateStage DatabaseAccountCreateStage = "RelayCreate" // ErrorStage is when the account has failed and won't be completed without changes. ErrorStage DatabaseAccountCreateStage = "Error" // ReadyStage is when the account is ready to be used. ReadyStage DatabaseAccountCreateStage = "Ready" // TerminatingStage is when the account is being removed. TerminatingStage DatabaseAccountCreateStage = "Terminating" )
func (DatabaseAccountCreateStage) String ¶
func (d DatabaseAccountCreateStage) String() string
type DatabaseAccountList ¶
type DatabaseAccountList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []DatabaseAccount `json:"items"` }
DatabaseAccountList contains a list of DatabaseAccount
+kubebuilder:object:root=true
func (*DatabaseAccountList) DeepCopy ¶
func (in *DatabaseAccountList) DeepCopy() *DatabaseAccountList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountList.
func (*DatabaseAccountList) DeepCopyInto ¶
func (in *DatabaseAccountList) DeepCopyInto(out *DatabaseAccountList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DatabaseAccountList) DeepCopyObject ¶
func (in *DatabaseAccountList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DatabaseAccountOnDelete ¶
type DatabaseAccountOnDelete string
DatabaseAccountOnDelete is the options that can be set for onDelete. +kubebuilder:validation:Enum=retain;delete
const ( // OnDeleteRetain retain the database and user. OnDeleteRetain DatabaseAccountOnDelete = "retain" // OnDeleteDelete delete the created database and user. OnDeleteDelete DatabaseAccountOnDelete = "delete" )
func (DatabaseAccountOnDelete) String ¶
func (d DatabaseAccountOnDelete) String() string
type DatabaseAccountSpec ¶
type DatabaseAccountSpec struct { // Username is the username for the postgresql Database account. Username string `json:"username,omitempty"` // OnDelete specifies if the database should be removed when the user is removed. //+optional // +kubebuilder:default:=delete OnDelete DatabaseAccountOnDelete `json:"onDelete,omitempty"` // CreateRelay will create a relay pod and use that for the DSN if requested. //+optional // +kubebuilder:default:=false CreateRelay bool `json:"createRelay,omitempty"` // Name is the basename used for the resource, if not specified a UUID will be used. //+optional Name PostgreSQLResourceName `json:"name,omitempty"` // SecretName is the optional name for the secret created with the DSN. //+optional SecretName string `json:"secretName,omitempty"` // SecretTemplate is the optional spec to be added to secrets generated by the DatabaseAccountSpec. SecretTemplate DatabaseAccountSpecSecretTemplate `json:"secretTemplate,omitempty"` }
DatabaseAccountSpec defines the desired state of DatabaseAccount.
func (*DatabaseAccountSpec) DeepCopy ¶
func (in *DatabaseAccountSpec) DeepCopy() *DatabaseAccountSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountSpec.
func (*DatabaseAccountSpec) DeepCopyInto ¶
func (in *DatabaseAccountSpec) DeepCopyInto(out *DatabaseAccountSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseAccountSpecSecretTemplate ¶
type DatabaseAccountSpecSecretTemplate struct { // Map of string keys and values that can be used to organize and categorize // (scope and select) objects. May match selectors of replication controllers // and services. // More info: http://kubernetes.io/docs/user-guide/labels //+optional Labels map[string]string `json:"labels,omitempty"` // Annotations is an unstructured key value map stored with a resource that may be // set by external tools to store and retrieve arbitrary metadata. They are not // queryable and should be preserved when modifying objects. // More info: http://kubernetes.io/docs/user-guide/annotations //+optional Annotations map[string]string `json:"annotations,omitempty"` }
DatabaseAccountSpecSecretTemplate defines the desired state of DatabaseAccount.
func (*DatabaseAccountSpecSecretTemplate) DeepCopy ¶
func (in *DatabaseAccountSpecSecretTemplate) DeepCopy() *DatabaseAccountSpecSecretTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountSpecSecretTemplate.
func (*DatabaseAccountSpecSecretTemplate) DeepCopyInto ¶
func (in *DatabaseAccountSpecSecretTemplate) DeepCopyInto(out *DatabaseAccountSpecSecretTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseAccountStatus ¶
type DatabaseAccountStatus struct { // State is the progress of creating the account. // // +optional //+kubebuilder:default:=Init Stage DatabaseAccountCreateStage `json:"stage,omitempty"` // Error is true if the DatabaseAccount is in error. // // +optional Error bool `json:"error,omitempty"` // ErrorMessage is the message if the Stage is Error. // // +optional ErrorMessage string `json:"errorMsg,omitempty"` // Name is the basename used for the resource. Name PostgreSQLResourceName `json:"name,omitempty"` // Ready is the boolean for when a resource is ready to use. // //+kubebuilder:default:=false Ready bool `json:"ready,omitempty"` }
DatabaseAccountStatus defines the observed state of DatabaseAccount.
func (*DatabaseAccountStatus) DeepCopy ¶
func (in *DatabaseAccountStatus) DeepCopy() *DatabaseAccountStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountStatus.
func (*DatabaseAccountStatus) DeepCopyInto ¶
func (in *DatabaseAccountStatus) DeepCopyInto(out *DatabaseAccountStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgreSQLDSN ¶
type PostgreSQLDSN string
PostgreSQLDSN is a kubernetes validation for a PostgreSQL DSN. +optional
func (PostgreSQLDSN) Host ¶
func (d PostgreSQLDSN) Host() string
func (PostgreSQLDSN) String ¶
func (d PostgreSQLDSN) String() string
type PostgreSQLResourceName ¶
type PostgreSQLResourceName string
PostgreSQLResourceName is a kubernetes validation for a PostgreSQL resource name. +optional +kubebuilder:validation:Pattern:="^[a-zA-Z_][a-zA-Z0-9_]+$" +kubebuilder:validation:MaxLength:=61
func (PostgreSQLResourceName) String ¶
func (d PostgreSQLResourceName) String() string