diff --git a/controllers/drupalsite_controller_test.go b/controllers/drupalsite_controller_test.go index 1844dee23704f90f8198ebff7e419183cc34d7d1..98258e1d7674d5f562a85d4dbc42289ef3b1a472 100644 --- a/controllers/drupalsite_controller_test.go +++ b/controllers/drupalsite_controller_test.go @@ -457,7 +457,7 @@ var _ = Describe("DrupalSite controller", func() { By("Expecting the clone labels to be set on the cloned site") Eventually(func() bool { k8sClient.Get(ctx, types.NamespacedName{Name: keyClone.Name, Namespace: keyClone.Namespace}, &cr) - return (cr.Labels["clonedFrom"] == key.Name && cr.Labels["clonedOn"] != "") + return (cr.Annotations["clonedFrom"] == key.Name && cr.Annotations["clonedOn"] != "") }, timeout, interval).Should(BeTrue()) // Check if the cloneFrom field is reset on the drupalSite diff --git a/controllers/drupalsite_controller_utils.go b/controllers/drupalsite_controller_utils.go index 4ad09501a5f6ce20e4eb861dae4b880adb2a50b3..399597cce1ac759c8d72154a5721191937643a49 100644 --- a/controllers/drupalsite_controller_utils.go +++ b/controllers/drupalsite_controller_utils.go @@ -199,14 +199,14 @@ func (r *DrupalSiteReconciler) ensureSpecFinalizer(ctx context.Context, drp *web update = true } } else { - if drp.Labels == nil { - drp.Labels = map[string]string{} + if drp.Annotations == nil { + drp.Annotations = map[string]string{} } // Source site name from which the clone was requested - drp.Labels["clonedFrom"] = string(drp.Spec.Configuration.CloneFrom) + drp.Annotations["clonedFrom"] = string(drp.Spec.Configuration.CloneFrom) // Set the time when the clone was requested - loc, _ := time.LoadLocation("") - drp.Labels["clonedOn"] = time.Now().In(loc).Format("Jan_2_2006_3-04pm_UTC") + loc, _ := time.LoadLocation("Europe/Zurich") + drp.Annotations["clonedOn"] = time.Now().In(loc).Format("Jan 2 2006 3:04PM CET") // Reset the `cloneFrom` field drp.Spec.Configuration.CloneFrom = "" update = true