Skip to content

Commit

Permalink
fix: reconcile annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Suleyman Akbas <[email protected]>
  • Loading branch information
suleymanakbas91 committed Nov 23, 2023
1 parent 54391ad commit 9f5ca3c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controllers/topolvm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,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
}

Expand Down
5 changes: 5 additions & 0 deletions controllers/topolvm_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,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
})

Expand Down
5 changes: 5 additions & 0 deletions controllers/vgmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9f5ca3c

Please sign in to comment.