v1

package
v0.0.0-...-1f03512 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the v1 API group +kubebuilder:object:generate=true +groupName=kubeprj.github.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "kubeprj.github.io", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
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"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Stage",type=string,JSONPath=`.status.stage`,description="deployment stage for database account" +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.ready`,description="ready status of database account" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" 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) Update

func (d *DatabaseAccount) Update(ctx context.Context, r client.Client) 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 string `json:"dsn,omitempty"`
}

DatabaseAccountControllerConfig is the Schema for the databaseaccountcontrollerconfigs API.

func (*DatabaseAccountControllerConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountControllerConfig.

func (*DatabaseAccountControllerConfig) DeepCopyInto

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.

type DatabaseAccountControllerConfigDebug

type DatabaseAccountControllerConfigDebug struct {
	ReconcileSleep int `json:"reconcileSleep,omitempty"`
}

func (*DatabaseAccountControllerConfigDebug) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountControllerConfigDebug.

func (*DatabaseAccountControllerConfigDebug) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DatabaseAccountCreateStage

type DatabaseAccountCreateStage string

DatabaseAccountCreateStage is the stage the account creation is up to. +kubebuilder:validation:Enum=Init;UserCreate;DatabaseCreate;Error;Ready

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"

	// 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"
)

func (DatabaseAccountCreateStage) 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.

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"`

	// 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

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseAccountSpecSecretTemplate.

func (*DatabaseAccountSpecSecretTemplate) DeepCopyInto

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

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

Jump to

Keyboard shortcuts

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