Add OwnerReferences to DaemonSet

This commit is contained in:
Nimrod Gilboa Markevich
2022-02-14 19:48:07 +02:00
parent 2f51858533
commit 6bc1bcd254

View File

@@ -949,11 +949,20 @@ func (provider *Provider) ApplyMizuTapperDaemonSet(ctx context.Context, namespac
})
podTemplate.WithSpec(podSpec)
ownerReferences := applyconfmeta.OwnerReference()
// ownerReferences.WithAPIVersion()
ownerReferences.WithKind("DaemonSet")
ownerReferences.WithName(daemonSetName)
// ownerReferences.WithUID()
// ownerReferences.WithController()
// ownerReferences.WithBlockOwnerDeletion()
labelSelector := applyconfmeta.LabelSelector()
labelSelector.WithMatchLabels(map[string]string{"app": tapperPodName})
daemonSet := applyconfapp.DaemonSet(daemonSetName, namespace)
daemonSet.
WithOwnerReferences(ownerReferences).
WithLabels(map[string]string{
LabelManagedBy: provider.managedBy,
LabelCreatedBy: provider.createdBy,