Skip to content

Commit

Permalink
Always allow cass-operator autoupdates
Browse files Browse the repository at this point in the history
  • Loading branch information
adejanovski committed Jun 6, 2024
1 parent 325dda4 commit 92b1784
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
8 changes: 1 addition & 7 deletions controllers/medusa/medusarestorejob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,7 @@ func updateMedusaRestoreInitContainer(req *medusa.RestoreRequest) error {
if err := setRestoreMappingInRestoreContainer(req.RestoreJob.Status.RestoreMapping, req.Datacenter); err != nil {
return err
}
// Temp workaround until this is fixed in cass-operator
setAutoUpdateSpecAnnotation(req.Datacenter)

return setRestoreKeyInRestoreContainer(req.RestoreJob.Status.RestoreKey, req.Datacenter)
}

Expand Down Expand Up @@ -476,8 +475,3 @@ func getRestoreInitContainerIndex(dc *cassdcapi.CassandraDatacenter) (int, error

return 0, fmt.Errorf("restore initContainer (%s) not found", restoreContainerName)
}

// There's a race condition that blocks restore job from completing after the DC is stopped. This is a temp workaround to fix it.
func setAutoUpdateSpecAnnotation(cassdc *cassdcapi.CassandraDatacenter) {
cassdc.ObjectMeta.Annotations["cassandra.datastax.com/autoupdate-spec"] = "once"
}
8 changes: 5 additions & 3 deletions pkg/cassandra/datacenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ func NewDatacenter(klusterKey types.NamespacedName, template *DatacenterConfig)

dc := &cassdcapi.CassandraDatacenter{
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
Name: template.Meta.Name,
Annotations: map[string]string{},
Namespace: namespace,
Name: template.Meta.Name,
Annotations: map[string]string{
cassdcapi.UpdateAllowedAnnotation: string(cassdcapi.AllowUpdateAlways),
},
Labels: utils.MergeMap(map[string]string{
api.NameLabel: api.NameLabelValue,
api.PartOfLabel: api.PartOfLabelValue,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func applyPollingDefaults() {
polling.medusaBackupDone.timeout = 10 * time.Minute
polling.medusaBackupDone.interval = 15 * time.Second

polling.medusaRestoreDone.timeout = 20 * time.Minute
polling.medusaRestoreDone.timeout = 15 * time.Minute
polling.medusaRestoreDone.interval = 15 * time.Second

polling.datacenterUpdating.timeout = 1 * time.Minute
Expand Down

0 comments on commit 92b1784

Please sign in to comment.