Skip to content

Commit

Permalink
Revert "fix(moniker): fix cluster if detail is set to empty via SpEL #…
Browse files Browse the repository at this point in the history
  • Loading branch information
asher authored and ajordens committed Dec 9, 2017
1 parent 993d24d commit a18e0f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a18e0f2

Please sign in to comment.