mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-06 21:09:19 +00:00
Force DaemonSet apply (#804)
Required for apply to work if the DaemonSet is created by another program e.g. Helm.
This commit is contained in:
parent
041223b558
commit
5484b7c491
@ -954,6 +954,11 @@ func (provider *Provider) ApplyMizuTapperDaemonSet(ctx context.Context, namespac
|
|||||||
labelSelector := applyconfmeta.LabelSelector()
|
labelSelector := applyconfmeta.LabelSelector()
|
||||||
labelSelector.WithMatchLabels(map[string]string{"app": tapperPodName})
|
labelSelector.WithMatchLabels(map[string]string{"app": tapperPodName})
|
||||||
|
|
||||||
|
applyOptions := metav1.ApplyOptions{
|
||||||
|
Force: true,
|
||||||
|
FieldManager: fieldManagerName,
|
||||||
|
}
|
||||||
|
|
||||||
daemonSet := applyconfapp.DaemonSet(daemonSetName, namespace)
|
daemonSet := applyconfapp.DaemonSet(daemonSetName, namespace)
|
||||||
daemonSet.
|
daemonSet.
|
||||||
WithLabels(map[string]string{
|
WithLabels(map[string]string{
|
||||||
@ -962,7 +967,7 @@ func (provider *Provider) ApplyMizuTapperDaemonSet(ctx context.Context, namespac
|
|||||||
}).
|
}).
|
||||||
WithSpec(applyconfapp.DaemonSetSpec().WithSelector(labelSelector).WithTemplate(podTemplate))
|
WithSpec(applyconfapp.DaemonSetSpec().WithSelector(labelSelector).WithTemplate(podTemplate))
|
||||||
|
|
||||||
_, err = provider.clientSet.AppsV1().DaemonSets(namespace).Apply(ctx, daemonSet, metav1.ApplyOptions{FieldManager: fieldManagerName})
|
_, err = provider.clientSet.AppsV1().DaemonSets(namespace).Apply(ctx, daemonSet, applyOptions)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user