Documentation ¶
Index ¶
- Constants
- Variables
- func AddPGBouncerConf(accountSvr accountsvr.Server, secret *corev1.Secret)
- func GetLogConstructor(mgr manager.Manager, obj runtime.Object) (func(*reconcile.Request) logr.Logger, error)
- func GetSecretKV(secret *corev1.Secret, key string) string
- func NewDatabaseAccountName(_ context.Context) dbov1.PostgreSQLResourceName
- func SecretAddOwnerRefs(secret *corev1.Secret, dbAccount *dbov1.DatabaseAccount)
- func SecretGet(ctx context.Context, r client.Reader, dbAccount *dbov1.DatabaseAccount) (*corev1.Secret, error)
- func SecretGetByName(ctx context.Context, r client.Reader, name types.NamespacedName) (*corev1.Secret, error)
- func SecretRun(ctx context.Context, r client.Reader, w client.Writer, ...) error
- func ServiceGet(ctx context.Context, r client.Reader, dbAccount *dbov1.DatabaseAccount) (*corev1.Service, error)
- func SetSecretKV(secret *corev1.Secret, key, value string)
- func StatefulSetGet(ctx context.Context, r client.Reader, ...) (*appsv1.StatefulSet, error)
- type DatabaseAccountReconciler
- type Recorder
- type RecorderEventType
- type RecorderReason
- type RecorderWrapper
- func (r *RecorderWrapper) Event(dbAccount *v1.DatabaseAccount, eventType RecorderEventType, ...)
- func (r *RecorderWrapper) NormalEvent(dbAccount *v1.DatabaseAccount, reason RecorderReason, message string)
- func (r *RecorderWrapper) WarningEvent(dbAccount *v1.DatabaseAccount, reason RecorderReason, message string)
- type SecretFunc
Constants ¶
View Source
const (
RatioForJitter = 2
)
Variables ¶
View Source
var ( // ErrNewSecret is returned when a secret was not able to be retrieved and so a new secret // was generated. ErrNewSecret = errors.New("creating new secret") // ErrNewStatefulSet is returned when a statefulset was not able to be retrieved and // so a new statefulset was generated. ErrNewStatefulSet = errors.New("creating new statefulset") // ErrNewService is returned when a service was not able to be retrieved and // so a new service was generated. ErrNewService = errors.New("creating new service") // ErrSecretImmutable is returned when a secret is immutable and can not be changed. ErrSecretImmutable = errors.New("secret is immutable") )
Functions ¶
func AddPGBouncerConf ¶
func AddPGBouncerConf( accountSvr accountsvr.Server, secret *corev1.Secret, )
func GetLogConstructor ¶
func NewDatabaseAccountName ¶
func NewDatabaseAccountName(_ context.Context) dbov1.PostgreSQLResourceName
NewDatabaseAccountName returns a newly generated database/username.
func SecretAddOwnerRefs ¶
func SecretAddOwnerRefs(secret *corev1.Secret, dbAccount *dbov1.DatabaseAccount)
func SecretGetByName ¶
func SecretRun ¶
func SecretRun( ctx context.Context, r client.Reader, w client.Writer, accountSvr accountsvr.Server, dbAccount *dbov1.DatabaseAccount, f SecretFunc, ) error
func ServiceGet ¶
func SetSecretKV ¶
func StatefulSetGet ¶
func StatefulSetGet( ctx context.Context, r client.Reader, ctrlConfig *dbov1.DatabaseAccountControllerConfig, dbAccount *dbov1.DatabaseAccount, ) (*appsv1.StatefulSet, error)
Types ¶
type DatabaseAccountReconciler ¶
type DatabaseAccountReconciler struct { client.Client Scheme *runtime.Scheme Recorder Recorder AccountServer accountsvr.Server Config *dbov1.DatabaseAccountControllerConfig }
DatabaseAccountReconciler reconciles a DatabaseAccount object.
func (*DatabaseAccountReconciler) Reconcile ¶
func (r *DatabaseAccountReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the DatabaseAccount object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile
func (*DatabaseAccountReconciler) SetupWithManager ¶
func (r *DatabaseAccountReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type Recorder ¶
type Recorder interface { NormalEvent(*v1.DatabaseAccount, RecorderReason, string) WarningEvent(*v1.DatabaseAccount, RecorderReason, string) }
func NewRecorder ¶
func NewRecorder(r record.EventRecorder) Recorder
type RecorderEventType ¶
type RecorderEventType string
const ( RecorderNormal RecorderEventType = "Normal" RecorderWarning RecorderEventType = "Warning" )
func (RecorderEventType) String ¶
func (r RecorderEventType) String() string
type RecorderReason ¶
type RecorderReason string
const ( ReasonQueued RecorderReason = "Queued" ReasonUserCreate RecorderReason = "UserCreate" ReasonDatabaseCreate RecorderReason = "DatabaseCreate" ReasonRelayCreate RecorderReason = "RelayCreate" ReasonReady RecorderReason = "Ready" )
func (RecorderReason) String ¶
func (r RecorderReason) String() string
type RecorderWrapper ¶
type RecorderWrapper struct {
// contains filtered or unexported fields
}
func (*RecorderWrapper) Event ¶
func (r *RecorderWrapper) Event( dbAccount *v1.DatabaseAccount, eventType RecorderEventType, reason RecorderReason, message string, )
func (*RecorderWrapper) NormalEvent ¶
func (r *RecorderWrapper) NormalEvent(dbAccount *v1.DatabaseAccount, reason RecorderReason, message string)
func (*RecorderWrapper) WarningEvent ¶
func (r *RecorderWrapper) WarningEvent(dbAccount *v1.DatabaseAccount, reason RecorderReason, message string)
type SecretFunc ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.