From 8820fe48da9d17773c4a5f004b99e565fb6b42a0 Mon Sep 17 00:00:00 2001 From: Abdelrhman Hamouda <7114320+AbdelrhmanHamouda@users.noreply.github.com> Date: Wed, 30 Nov 2022 12:02:11 +0100 Subject: [PATCH] fix(63): Correctly apply k8s service selector (#64) --- .../resource/manage/ResourceCreationHelpers.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/locust/operator/controller/utils/resource/manage/ResourceCreationHelpers.java b/src/main/java/com/locust/operator/controller/utils/resource/manage/ResourceCreationHelpers.java index 1fdf0b1..c10ba5c 100644 --- a/src/main/java/com/locust/operator/controller/utils/resource/manage/ResourceCreationHelpers.java +++ b/src/main/java/com/locust/operator/controller/utils/resource/manage/ResourceCreationHelpers.java @@ -163,16 +163,16 @@ private PodTemplateSpec prepareSpecTemplate(LoadGenerationNode nodeConfig, Strin *

* Reference: Kubernetes Job Docs * - * @param nodeConfig The node configuration object - * @param nodeName The node name - * @return PodTemplateSpec + * @param nodeConfig The node configuration object. + * @param testName Test name. + * @return PodTemplateSpec. */ - private ObjectMeta prepareTemplateMetadata(LoadGenerationNode nodeConfig, String nodeName) { + private ObjectMeta prepareTemplateMetadata(LoadGenerationNode nodeConfig, String testName) { ObjectMeta templateMeta = new ObjectMetaBuilder() // Labels - .addToLabels(APP_DEFAULT_LABEL, nodeConfig.getName()) - .addToLabels(SERVICE_SELECTOR_LABEL, nodeName) + .addToLabels(APP_DEFAULT_LABEL, testName) + .addToLabels(SERVICE_SELECTOR_LABEL, nodeConfig.getName()) .addToLabels(nodeConfig.getLabels()) // Annotations