diff --git a/controllers/topolvm_controller.go b/controllers/topolvm_controller.go index bd255355f..e6e14aca6 100644 --- a/controllers/topolvm_controller.go +++ b/controllers/topolvm_controller.go @@ -121,6 +121,11 @@ func (c topolvmController) setTopolvmControllerDesiredState(existing, desired *a existing.Spec.Template.Spec.Containers = desired.Spec.Template.Spec.Containers existing.Spec.Template.Spec.InitContainers = desired.Spec.Template.Spec.InitContainers + initMapIfNil(&existing.ObjectMeta.Annotations) + for key, value := range desired.Annotations { + existing.ObjectMeta.Annotations[key] = value + } + return nil } diff --git a/controllers/topolvm_node.go b/controllers/topolvm_node.go index c3168cba8..1291740f2 100644 --- a/controllers/topolvm_node.go +++ b/controllers/topolvm_node.go @@ -89,6 +89,11 @@ func (n topolvmNode) ensureCreated(r *LVMClusterReconciler, ctx context.Context, setDaemonsetNodeSelector(dsTemplate.Spec.Template.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution, ds) } + initMapIfNil(&ds.ObjectMeta.Annotations) + for key, value := range dsTemplate.Annotations { + ds.ObjectMeta.Annotations[key] = value + } + return nil }) diff --git a/controllers/vgmanager.go b/controllers/vgmanager.go index 78a994304..35d577650 100644 --- a/controllers/vgmanager.go +++ b/controllers/vgmanager.go @@ -77,6 +77,11 @@ func (v vgManager) ensureCreated(r *LVMClusterReconciler, ctx context.Context, l ds.Spec.Template.ObjectMeta.Labels[key] = value } + initMapIfNil(&ds.ObjectMeta.Annotations) + for key, value := range dsTemplate.Annotations { + ds.ObjectMeta.Annotations[key] = value + } + // containers ds.Spec.Template.Spec.Containers = dsTemplate.Spec.Template.Spec.Containers