-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Updated Conditon in Status #546
Conversation
@YZ775 |
a21f064
to
60e7997
Compare
Please add documentation for this feature to reconcile.md. |
1e924b7
to
cb5e6f7
Compare
log := crlog.FromContext(ctx) | ||
orig := cluster.DeepCopy() | ||
|
||
if cluster.Status.ReconcileInfo.Generation != cluster.Generation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if statement is unnecessary.
Currently, we use DeepEqual()
to determine whether or not an update is required.
…Condition Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> add envtest Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update gomod Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update envtest and add e2e Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update apidoc Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> rename Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> add ObservedGeneration and add partition handling, and update e2e test Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> remove unnecessary ObservedGeneration and move updateStatus() after reconcileV1StatefulSet() , and update e2e test Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> add document about UpToDate Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update against review Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> wip change status to StatefulSetReady and add ReconcileSuccess, and fix unstable test Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> remove unnecessary condition check Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> remove redundant assignments in updateStatusByStatefulSet Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> move updateReconcileStatus in reconcileV1 Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> fix controller test Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update documents Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update lifecycle_test.go to check StatefulSetReady condition Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> fix auto generated document Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> join update status funcion Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> revert Eventually in envtest Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> fix multiple Update() call Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update docs Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> fix controller Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update condition when sts not found Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update test Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> update lifecycle_test.go Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> fix condition Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> fix generation check and err handling Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> do not show err log when deletion of cluster Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp> add StatefulSet condition and change MySQLClusterCondition to metav1.Condition Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp>
482edb0
to
b7d6985
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The health status in
MySQLCluster.Status.Condition
will be true even if all StatefulSet is not ready when updating MySQLCluster.So if we use this status as a health check in ArgoCD, they proceed next wave in spite of the update of MySQLCluster is not finished.
As a solution to this problem, I added
ConditionUpdated
Condition inMySQLCluster.Status.Condition
.This condition will become true when an update of Statefulset is finished.
This PR contains following improvement
metav1.Condition
instead ofMySQLClusterCondition