diff --git a/controllers/medusa/medusarestorejob_controller.go b/controllers/medusa/medusarestorejob_controller.go index 7412ff2e7..0c85551e1 100644 --- a/controllers/medusa/medusarestorejob_controller.go +++ b/controllers/medusa/medusarestorejob_controller.go @@ -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) } @@ -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" -} diff --git a/pkg/cassandra/datacenter.go b/pkg/cassandra/datacenter.go index 22e985abc..1162a96e3 100644 --- a/pkg/cassandra/datacenter.go +++ b/pkg/cassandra/datacenter.go @@ -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, diff --git a/test/e2e/suite_test.go b/test/e2e/suite_test.go index 7c03654e8..bb4686113 100644 --- a/test/e2e/suite_test.go +++ b/test/e2e/suite_test.go @@ -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