Fix the issues in worker DaemonSet

This commit is contained in:
M. Mert Yildiran
2023-04-11 02:33:17 +03:00
parent f19db77228
commit 39d1b77045
4 changed files with 26 additions and 13 deletions

View File

@@ -809,10 +809,7 @@ func (provider *Provider) BuildWorkerDaemonSet(
}
// Pod
pod := core.Pod{
TypeMeta: metav1.TypeMeta{
Kind: "Pod",
},
pod := DaemonSetPod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
Namespace: config.Config.Tap.SelfNamespace,
@@ -847,6 +844,13 @@ func (provider *Provider) BuildWorkerDaemonSet(
Kind: "DaemonSet",
APIVersion: "apps/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: podName,
Namespace: config.Config.Tap.SelfNamespace,
Labels: buildWithDefaultLabels(map[string]string{
"app": podName,
}, provider),
},
Spec: DaemonSetSpec{
Selector: metav1.LabelSelector{
MatchLabels: buildWithDefaultLabels(map[string]string{

View File

@@ -9,9 +9,14 @@ import (
applyconfmeta "k8s.io/client-go/applyconfigurations/meta/v1"
)
type DaemonSetPod struct {
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Spec core.PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}
type DaemonSetSpec struct {
Selector metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
Template core.Pod `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"`
Template DaemonSetPod `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"`
}
type DaemonSet struct {