Skip to content

Commit ef3de55

Browse files
scooby87myasnikovdaniil
authored andcommitted
docs(mariadb): list the operator's Failed reason on the Complete condition
The reason list read as everything the operator writes on Complete, yet mariadb-operator also sets Complete=False with reason Failed when a run fails before or outside its Job. A reader taking the list as exhaustive would treat Failed as an unknown reason, or make it terminal, while the operator retries those failures. A table row pins that the driver keeps waiting on it. Assisted-by: LLM Signed-off-by: Alexey Artamonov <[email protected]> (cherry picked from commit 5f0da5a) Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 7532e4b commit ef3de55

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎internal/backupcontroller/mariadbstrategy_controller_test.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,7 @@ var mariadbCompleteOutcomeCases = []struct {
896896
{name: "Complete=True with an unknown reason keeps waiting", status: metav1.ConditionTrue, reason: "SomethingElse", message: "Something"},
897897
{name: "Complete=False/JobComplete keeps waiting", status: metav1.ConditionFalse, reason: mariadbtypes.ConditionReasonJobComplete, message: "Success"},
898898
{name: "Complete=False/JobRunning keeps waiting", status: metav1.ConditionFalse, reason: mariadbtypes.ConditionReasonJobRunning, message: "Running"},
899+
{name: "Complete=False/Failed keeps waiting", status: metav1.ConditionFalse, reason: "Failed", message: "Error creating Job"},
899900
{name: "no Complete condition keeps waiting", noCondition: true},
900901
{name: "no Complete condition past the deadline fails", noCondition: true, expired: true, wantFailed: true,
901902
wantMessage: []string{"no Complete condition observed"}},

‎internal/backupcontroller/mariadbtypes/types.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ const (
3737
// JobFailed -> Status=True (terminal failure of the backing Job).
3838
// JobRunning -> Status=False (still in progress).
3939
// JobSuspended -> Status=False (admin-suspended via spec).
40+
// The operator also writes reason Failed with Status=False and its own
41+
// message ("Error creating Job", "Backup not complete") when a run fails
42+
// outside its Job. It retries those, so the driver keeps waiting on
43+
// Failed until its deadline rather than failing the run at once.
4044
ConditionReasonJobComplete = "JobComplete"
4145
ConditionReasonJobFailed = "JobFailed"
4246
ConditionReasonJobRunning = "JobRunning"

0 commit comments

Comments
 (0)