-
Notifications
You must be signed in to change notification settings - Fork 21
CLOUDP-350375: MongoDBMultiCluster
: Add annotation to disable reconciliation
#511
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -135,6 +135,11 @@ func (r *ReconcileMongoDbMultiReplicaSet) Reconcile(ctx context.Context, request | |||||||||||||
return reconcileResult, err | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
if val, ok := mrs.Annotations[util.DisableReconciliation]; ok && val == util.DisableReconciliationValue { | ||||||||||||||
log.Info("Reconciliation disabled") | ||||||||||||||
return r.updateStatus(ctx, &mrs, workflow.Disabled(), log) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. q: It looks like disabled workflow was introduced to notify if a subresource is enabled or disabled. would it be a good idea to use the same to notify that a resource is deprecated? I was also wondering if we should call it disabled or deprecated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @viveksinghggits I found this: mongodb-kubernetes/api/v1/status/phase.go Lines 20 to 21 in 219a3df
I believe these statuses are generic. It just happened so that we only use it currently to report that a backup is disabled. But I think there is no reason not to use it for anything else. I'm happy to update this comment to reflect this: mongodb-kubernetes/controllers/operator/workflow/disabled.go Lines 7 to 10 in 219a3df
We might be adding a deprecation message somewhere on the resource. But it will likely going to be a permanent message. For the purpose of migration we need a status which can be used to programmatically check that the resource is not being reconciled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think just updating the comment should be ok. Just wanted to bring the attention to that comment, not a big issue. |
||||||||||||||
} | ||||||||||||||
|
||||||||||||||
if !architectures.IsRunningStaticArchitecture(mrs.Annotations) { | ||||||||||||||
agents.UpgradeAllIfNeeded(ctx, agents.ClientSecret{Client: r.client, SecretClient: r.SecretClient}, r.omConnectionFactory, GetWatchedNamespace(), true) | ||||||||||||||
} | ||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -285,6 +285,9 @@ const ( | |
LastAchievedSpec = "mongodb.com/v1.lastSuccessfulConfiguration" | ||
LastAchievedRsMemberIds = "mongodb.com/v1.lastAchievedRsMemberIds" | ||
|
||
DisableReconciliation = "mongodb.com/v1.disableReconciliation" | ||
DisableReconciliationValue = "true" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had to define a constant because linter was not happy. |
||
|
||
// SecretVolumeName is the name of the volume resource. | ||
SecretVolumeName = "secret-certs" | ||
|
||
|
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.
It will be something our users will be using during migration, but as part of this PR I"m not going to document the annotation/add a release note. It will be included in the migration guide once we release a version which is ready for migration. Until then - let's leave it undocumented.