From e10b69f541b8cad3f03fcf45f791bb29cddc6f98 Mon Sep 17 00:00:00 2001 From: franzmueller Date: Tue, 23 Jan 2024 14:13:38 +0100 Subject: [PATCH] fix import type label --- lib/deploy/rancher2-api/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/deploy/rancher2-api/api.go b/lib/deploy/rancher2-api/api.go index 65ae6b9..ae6e505 100644 --- a/lib/deploy/rancher2-api/api.go +++ b/lib/deploy/rancher2-api/api.go @@ -62,7 +62,7 @@ func (r *Rancher2) CreateContainer(name string, image string, env map[string]str labels := map[string]string{ "user": userid, "importId": name, - "importTypeId": importTypeId, + "importTypeId": strings.ReplaceAll(importTypeId, ":", "_"), } reqBody := &Request{ Name: name, @@ -117,7 +117,7 @@ func (r *Rancher2) CreateContainer(name string, image string, env map[string]str request.Url = r.url + "projects/" + r.projectId if restart { request.Url += "/workloads" - reqBody.Selector = Selector{MatchLabels: map[string]string{"importId": name}} + reqBody.Selector = Selector{MatchLabels: labels} autoscaleRequestBody.Spec.TargetRef.ApiVersion = "apps/v1" autoscaleRequestBody.Spec.TargetRef.Kind = "Deployment" } else {