Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions controllers/galera_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,12 @@ func (r *GaleraReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res
time.Duration(5)*time.Second)
if err != nil {
if k8s_errors.IsNotFound(err) {
// Since the OpenStack secret should have been manually created by the user and referenced in the spec,
// we treat this as a warning because it means that the service will not be able to start.
instance.Status.Conditions.Set(condition.FalseCondition(
condition.InputReadyCondition,
condition.RequestedReason,
condition.SeverityInfo,
condition.ErrorReason,
condition.SeverityWarning,
condition.InputReadyWaitingMessage))
return res, fmt.Errorf("%w: %s", ErrOpenStackSecretNotFound, instance.Spec.Secret)
}
Expand Down Expand Up @@ -610,10 +612,12 @@ func (r *GaleraReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res
)
if err != nil {
if k8s_errors.IsNotFound(err) {
// Since the CA bundle secret should have been manually created by the user and provided in the spec,
// we treat this as a warning because it means that the service will not be able to start.
instance.Status.Conditions.Set(condition.FalseCondition(
condition.TLSInputReadyCondition,
condition.RequestedReason,
condition.SeverityInfo,
condition.ErrorReason,
condition.SeverityWarning,
condition.TLSInputReadyWaitingMessage, instance.Spec.TLS.CaBundleSecretName))
return ctrl.Result{}, nil
}
Expand Down
7 changes: 4 additions & 3 deletions controllers/galerabackup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,11 @@ func (r *GaleraBackupReconciler) Reconcile(ctx context.Context, req ctrl.Request
if err != nil {
if k8s_errors.IsNotFound(err) {
// Wait for a Galera object to exist before creating any object (cronjob, PVs...)
// Since the Galera object should already exist, we treat this as a warning.
instance.Status.Conditions.MarkFalse(
mariadbv1.MariaDBResourceExistsCondition,
mariadbv1.ReasonResourceNotFound,
condition.SeverityInfo,
condition.SeverityWarning,
mariadbv1.MariaDBResourceInitMessage,
)
return ctrl.Result{RequeueAfter: time.Duration(10) * time.Second}, nil
Expand Down Expand Up @@ -316,8 +317,8 @@ func (r *GaleraBackupReconciler) Reconcile(ctx context.Context, req ctrl.Request
helper.GetLogger().Error(err, "CreateOrPatch failed", "pod", backupCronJob.Name)
instance.Status.Conditions.MarkFalse(
mariadbv1.CronjobReadyCondition,
condition.ReadyReason,
condition.SeverityInfo,
condition.ErrorReason,
condition.SeverityWarning,
mariadbv1.CronjobReadyErrorMessage,
err,
)
Expand Down
8 changes: 5 additions & 3 deletions controllers/mariadbaccount_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ func (r *MariaDBAccountReconciler) reconcileCreate(
if err != nil && k8s_errors.IsNotFound(err) {
// for the create case, need to wait for the MariaDBDatabase to exists before we can continue;
// requeue
// Since the MariaDBDatabase object should already exist, we treat this as a warning.

instance.Status.Conditions.Set(condition.FalseCondition(
databasev1beta1.MariaDBDatabaseReadyCondition,
databasev1beta1.ReasonDBNotFound,
condition.SeverityInfo,
condition.SeverityWarning,
databasev1beta1.MariaDBDatabaseReadyInitMessage))

log.Info(fmt.Sprintf(
Expand Down Expand Up @@ -275,11 +276,12 @@ func (r *MariaDBAccountReconciler) reconcileCreate(
time.Duration(30)*time.Second,
)
if (err != nil || secretResult != ctrl.Result{}) {

// Since the account secret should have been manually created by the user and referenced in the spec,
// we treat this as a warning because it means that the service will not be able to start.
instance.Status.Conditions.Set(condition.FalseCondition(
databasev1beta1.MariaDBAccountReadyCondition,
secret.ReasonSecretMissing,
condition.SeverityInfo,
condition.SeverityWarning,
databasev1beta1.MariaDBAccountSecretNotReadyMessage, err))

return secretResult, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ status:
conditions:
# message: 'MariaDBAccount secret is missing or incomplete: Secret $NAMESPACE/some-db-secret not found'
- reason: SecretMissing
severity: Info
severity: Warning
status: "False"
type: Ready
# message: 'MariaDBAccount secret is missing or incomplete: Secret $NAMESPACE/some-db-secret not found'
- reason: SecretMissing
severity: Info
severity: Warning
status: "False"
type: MariaDBAccountReady
- message: MariaDBDatabase ready
Expand Down
4 changes: 2 additions & 2 deletions tests/kuttl/tests/account_create/03-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ status:
conditions:
# message: 'MariaDBAccount secret is missing or incomplete: Secret $NAMESPACE/some-db-secret not found'
- reason: SecretMissing
severity: Info
severity: Warning
status: "False"
type: Ready
# message: 'MariaDBAccount secret is missing or incomplete: Secret $NAMESPACE/some-db-secret not found'
- reason: SecretMissing
severity: Info
severity: Warning
status: "False"
type: MariaDBAccountReady
- message: MariaDBDatabase ready
Expand Down