From d2b7a89e163686ff2a1ab12b6050943331512288 Mon Sep 17 00:00:00 2001 From: DangPeng Liu Date: Tue, 24 Dec 2024 18:44:12 +0800 Subject: [PATCH] fix deployment always update Signed-off-by: DangPeng Liu --- .../agent/multicluster-global-hub-agent-deployment.yaml | 2 ++ .../multicluster-global-hub-hosting-agent-deployment.yaml | 2 ++ .../agent/manifests/templates/hubcluster/hubcluster-mch.yaml | 2 ++ operator/pkg/controllers/grafana/manifests/deployment.yaml | 2 ++ operator/pkg/controllers/inventory/manifests/deployment.yaml | 2 ++ operator/pkg/controllers/manager/manifests/deployment.yaml | 2 ++ .../controllers/storage/manifests.sts/postgres-statefulset.yaml | 2 ++ operator/pkg/renderer/testdata/app/nginx-deployment.yaml | 2 ++ 8 files changed, 16 insertions(+) diff --git a/operator/pkg/controllers/agent/manifests/templates/agent/multicluster-global-hub-agent-deployment.yaml b/operator/pkg/controllers/agent/manifests/templates/agent/multicluster-global-hub-agent-deployment.yaml index 56c08f2c4..580a14024 100644 --- a/operator/pkg/controllers/agent/manifests/templates/agent/multicluster-global-hub-agent-deployment.yaml +++ b/operator/pkg/controllers/agent/manifests/templates/agent/multicluster-global-hub-agent-deployment.yaml @@ -73,7 +73,9 @@ spec: {{- range .Tolerations}} - key: "{{.Key}}" operator: "{{.Operator}}" + {{- if .Value}} value: "{{.Value}}" + {{- end}} effect: "{{.Effect}}" {{- if .TolerationSeconds}} tolerationSeconds: {{.TolerationSeconds}} diff --git a/operator/pkg/controllers/agent/manifests/templates/hostedagent/multicluster-global-hub-hosting-agent-deployment.yaml b/operator/pkg/controllers/agent/manifests/templates/hostedagent/multicluster-global-hub-hosting-agent-deployment.yaml index 630859261..3482d3c72 100644 --- a/operator/pkg/controllers/agent/manifests/templates/hostedagent/multicluster-global-hub-hosting-agent-deployment.yaml +++ b/operator/pkg/controllers/agent/manifests/templates/hostedagent/multicluster-global-hub-hosting-agent-deployment.yaml @@ -63,7 +63,9 @@ spec: {{- range .Tolerations}} - key: "{{.Key}}" operator: "{{.Operator}}" + {{- if .Value}} value: "{{.Value}}" + {{- end}} effect: "{{.Effect}}" {{- if .TolerationSeconds}} tolerationSeconds: {{.TolerationSeconds}} diff --git a/operator/pkg/controllers/agent/manifests/templates/hubcluster/hubcluster-mch.yaml b/operator/pkg/controllers/agent/manifests/templates/hubcluster/hubcluster-mch.yaml index b5cfe2dc0..dc992b4d0 100644 --- a/operator/pkg/controllers/agent/manifests/templates/hubcluster/hubcluster-mch.yaml +++ b/operator/pkg/controllers/agent/manifests/templates/hubcluster/hubcluster-mch.yaml @@ -20,7 +20,9 @@ spec: {{- range .Tolerations}} - key: "{{.Key}}" operator: "{{.Operator}}" + {{- if .Value}} value: "{{.Value}}" + {{- end}} effect: "{{.Effect}}" {{ if .TolerationSeconds }} tolerationSeconds: {{ .TolerationSeconds }} {{- end }} {{- end}} diff --git a/operator/pkg/controllers/grafana/manifests/deployment.yaml b/operator/pkg/controllers/grafana/manifests/deployment.yaml index 93bb52ab7..cac4c1e80 100644 --- a/operator/pkg/controllers/grafana/manifests/deployment.yaml +++ b/operator/pkg/controllers/grafana/manifests/deployment.yaml @@ -167,7 +167,9 @@ spec: {{- range .Tolerations}} - key: "{{.Key}}" operator: "{{.Operator}}" + {{- if .Value}} value: "{{.Value}}" + {{- end}} effect: "{{.Effect}}" {{- if .TolerationSeconds}} tolerationSeconds: {{.TolerationSeconds}} diff --git a/operator/pkg/controllers/inventory/manifests/deployment.yaml b/operator/pkg/controllers/inventory/manifests/deployment.yaml index 12dcf295f..e1b16dce0 100644 --- a/operator/pkg/controllers/inventory/manifests/deployment.yaml +++ b/operator/pkg/controllers/inventory/manifests/deployment.yaml @@ -102,7 +102,9 @@ spec: {{- range .Tolerations}} - key: "{{.Key}}" operator: "{{.Operator}}" + {{- if .Value}} value: "{{.Value}}" + {{- end}} effect: "{{.Effect}}" {{- if .TolerationSeconds}} tolerationSeconds: {{.TolerationSeconds}} diff --git a/operator/pkg/controllers/manager/manifests/deployment.yaml b/operator/pkg/controllers/manager/manifests/deployment.yaml index 8c2f13645..afe8779aa 100644 --- a/operator/pkg/controllers/manager/manifests/deployment.yaml +++ b/operator/pkg/controllers/manager/manifests/deployment.yaml @@ -151,7 +151,9 @@ spec: {{- range .Tolerations}} - key: "{{.Key}}" operator: "{{.Operator}}" + {{- if .Value}} value: "{{.Value}}" + {{- end}} effect: "{{.Effect}}" {{- if .TolerationSeconds}} tolerationSeconds: {{.TolerationSeconds}} diff --git a/operator/pkg/controllers/storage/manifests.sts/postgres-statefulset.yaml b/operator/pkg/controllers/storage/manifests.sts/postgres-statefulset.yaml index 092b80f1d..4d6a8b497 100644 --- a/operator/pkg/controllers/storage/manifests.sts/postgres-statefulset.yaml +++ b/operator/pkg/controllers/storage/manifests.sts/postgres-statefulset.yaml @@ -130,7 +130,9 @@ spec: {{- range .Tolerations}} - key: "{{.Key}}" operator: "{{.Operator}}" + {{- if .Value}} value: "{{.Value}}" + {{- end}} effect: "{{.Effect}}" {{- if .TolerationSeconds}} tolerationSeconds: {{.TolerationSeconds}} diff --git a/operator/pkg/renderer/testdata/app/nginx-deployment.yaml b/operator/pkg/renderer/testdata/app/nginx-deployment.yaml index 2014d99b8..616a8de13 100644 --- a/operator/pkg/renderer/testdata/app/nginx-deployment.yaml +++ b/operator/pkg/renderer/testdata/app/nginx-deployment.yaml @@ -74,7 +74,9 @@ spec: {{- range .Tolerations}} - key: "{{.Key}}" operator: "{{.Operator}}" + {{- if .Value}} value: "{{.Value}}" + {{- end}} effect: "{{.Effect}}" {{- if .TolerationSeconds}} tolerationSeconds: {{.TolerationSeconds}}