Skip to content

Commit

Permalink
fix(hatchery:k8s): remove wm path label (#7323)
Browse files Browse the repository at this point in the history
Signed-off-by: richardlt <[email protected]>
  • Loading branch information
richardlt authored Feb 27, 2025
1 parent 8e8fde0 commit 13f74ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions engine/hatchery/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/cdsclient"
"github.com/ovh/cds/sdk/hatchery"
"github.com/ovh/cds/sdk/slug"
"github.com/ovh/cds/sdk/telemetry"
)

Expand Down Expand Up @@ -349,9 +348,8 @@ func (h *HatcheryKubernetes) SpawnWorker(ctx context.Context, spawnArgs hatchery
Namespace: h.Config.Namespace,
DeletionGracePeriodSeconds: &gracePeriodSecs,
Labels: map[string]string{
LABEL_HATCHERY_NAME: h.Configuration().Name,
LABEL_WORKER_NAME: workerConfig.Name,
LABEL_WORKER_MODEL_PATH: slug.Convert(spawnArgs.Model.GetPath()),
LABEL_HATCHERY_NAME: h.Configuration().Name,
LABEL_WORKER_NAME: workerConfig.Name,
},
Annotations: map[string]string{},
},
Expand Down
1 change: 0 additions & 1 deletion engine/hatchery/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func TestHatcheryKubernetes_Status(t *testing.T) {
require.Equal(t, "666", podRequest.Labels[hatchery.LabelServiceJobID])
require.Equal(t, "999", podRequest.Labels[hatchery.LabelServiceNodeRunID])
require.Equal(t, "my-worker", podRequest.Labels[LABEL_WORKER_NAME])
require.Equal(t, "group-model1", podRequest.Labels[LABEL_WORKER_MODEL_PATH])

require.Equal(t, 2, len(podRequest.Spec.Containers))
require.Equal(t, "my-worker", podRequest.Spec.Containers[0].Name)
Expand Down
5 changes: 2 additions & 3 deletions engine/hatchery/kubernetes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (
)

const (
LABEL_HATCHERY_NAME = "CDS_HATCHERY_NAME"
LABEL_WORKER_NAME = "CDS_WORKER_NAME"
LABEL_WORKER_MODEL_PATH = "CDS_WORKER_MODEL_PATH"
LABEL_HATCHERY_NAME = "CDS_HATCHERY_NAME"
LABEL_WORKER_NAME = "CDS_WORKER_NAME"
)

var containerServiceNameRegexp = regexp.MustCompile(`service-([0-9]+)-(.*)`)
Expand Down

0 comments on commit 13f74ff

Please sign in to comment.