From 031a0012874941ed232d670ac34ce18c0f206206 Mon Sep 17 00:00:00 2001 From: gshaibi <39763067+gshaibi@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:25:47 +0300 Subject: [PATCH] RUN-20245 Status updater topology configmap race fix (#87) --- .../fake-gpu-operator/templates/status-updater/deployment.yaml | 2 ++ internal/status-updater/handlers/node/labels.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/fake-gpu-operator/templates/status-updater/deployment.yaml b/deploy/fake-gpu-operator/templates/status-updater/deployment.yaml index f45b34b..4d58983 100644 --- a/deploy/fake-gpu-operator/templates/status-updater/deployment.yaml +++ b/deploy/fake-gpu-operator/templates/status-updater/deployment.yaml @@ -14,6 +14,8 @@ spec: replicas: 1 template: metadata: + annotations: + checksum/topology: {{ include (print $.Template.BasePath "/topology-cm.yml") . | sha256sum }} labels: app: status-updater component: status-updater diff --git a/internal/status-updater/handlers/node/labels.go b/internal/status-updater/handlers/node/labels.go index f05315a..9b297eb 100644 --- a/internal/status-updater/handlers/node/labels.go +++ b/internal/status-updater/handlers/node/labels.go @@ -6,6 +6,7 @@ import ( "fmt" v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) @@ -34,7 +35,7 @@ func (p *NodeHandler) unlabelNode(node *v1.Node) error { dcgmExporterLabelKey: nil, devicePluginLabelKey: nil, }) - if err != nil { + if err != nil && !errors.IsNotFound(err) { return fmt.Errorf("failed to unlabel node %s: %w", node.Name, err) }