-
Notifications
You must be signed in to change notification settings - Fork 521
CLOUDP-59612: Configure StatefulSet UpdatePolicy #31
CLOUDP-59612: Configure StatefulSet UpdatePolicy #31
Conversation
…59033_mongo_uri_in_status
| func getUpdateStrategyType(mdb mdbv1.MongoDB) appsv1.StatefulSetUpdateStrategyType { | ||
| if !mdb.ChangingVersion() { | ||
| return appsv1.RollingUpdateStatefulSetStrategyType | ||
| } | ||
| return appsv1.OnDeleteStatefulSetStrategyType | ||
| } |
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.
rodrigovalin
left a comment
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.
The status structure should be used to indicate status to a client (a person most of the time), but not for us to keep our temporary values between reconciliation.
What about "last-saved-configuration" to maintain what was "before" the current changes?
pkg/apis/mongodb/v1/mongodb_types.go
Outdated
| func (m *MongoDB) UpdateSuccess() { | ||
| m.Status.MongoURI = m.MongoURI() | ||
| m.Status.Phase = Running | ||
| m.Status.Version = m.Spec.Version |
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.
we should not add the version to the status, given that it is already on the spec.
| if !statefulset.IsReady(set) { | ||
| log.Infof("Stateful Set has not yet reached the ready state, requeuing reconciliation") | ||
| return reconcile.Result{RequeueAfter: time.Second * 10}, nil | ||
| return fmt.Errorf("stateful Set has not yet reached the ready state, requeuing reconciliation"), time.Second * 10 |
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 should log as info instead, this is not an "errorneous" situation.
rodrigovalin
left a comment
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!
This is looking really promising!

All Submissions:
closes #XXXXin your comment to auto-close the issue that your PR fixes (if such).Tested changing version manually
And when the pod is deleted manually, it restarts and reaches goal state, correctly joining the replica set