Skip to content

Commit

Permalink
Merge pull request openshift#513 from suleymanakbas91/release-4.14
Browse files Browse the repository at this point in the history
[release-4.14] OCPBUGS-23777: fix: reconcile annotations
  • Loading branch information
suleymanakbas91 authored Dec 1, 2023
2 parents 6c1a9fc + dbd9a8d commit e0185b3
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 @@ -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
}

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

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 e0185b3

Please sign in to comment.