diff --git a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/utils/MonikerHelper.java b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/utils/MonikerHelper.java index a259c8d41a..e93274e8b4 100644 --- a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/utils/MonikerHelper.java +++ b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/utils/MonikerHelper.java @@ -18,10 +18,7 @@ import com.netflix.frigga.Names; import com.netflix.spinnaker.moniker.Moniker; -import com.netflix.spinnaker.orca.clouddriver.pipeline.servergroup.support.TargetServerGroup; -import com.netflix.spinnaker.orca.clouddriver.pipeline.servergroup.support.TargetServerGroupResolver; import com.netflix.spinnaker.orca.pipeline.model.Stage; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; @@ -57,11 +54,7 @@ public String getClusterNameFromStage(Stage stage, String fallbackFriggaName) { static public Moniker monikerFromStage(Stage stage) { if (stage.getContext().containsKey("moniker")) { - Moniker moniker = stage.mapTo("/moniker", Moniker.class); - if (moniker.getCluster().endsWith("-")) { - moniker.setCluster(StringUtils.stripEnd(moniker.getCluster(), "-")); - } - return moniker; + return (Moniker) stage.mapTo("/moniker", Moniker.class); } else { return null; } diff --git a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/pipeline/support/StageData.groovy b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/pipeline/support/StageData.groovy index 0820ad9d65..ce51bb8510 100644 --- a/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/pipeline/support/StageData.groovy +++ b/orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/kato/pipeline/support/StageData.groovy @@ -18,7 +18,6 @@ package com.netflix.spinnaker.orca.kato.pipeline.support import com.netflix.frigga.autoscaling.AutoScalingGroupNameBuilder import com.netflix.spinnaker.moniker.Moniker -import org.apache.commons.lang3.StringUtils class StageData { String strategy @@ -48,7 +47,7 @@ class StageData { String getCluster() { if (moniker?.cluster) { - return StringUtils.stripEnd(moniker.cluster, "-") + return moniker.cluster } else { def builder = new AutoScalingGroupNameBuilder() builder.appName = application