Skip to content

Commit

Permalink
Leave TaskRoleArn null if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlwilson committed Aug 3, 2024
1 parent 1307f06 commit 01ebeeb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.thoughtworks.gocd.elasticagent.ecs.domain.ElasticAgentProfileProperties;
import com.thoughtworks.gocd.elasticagent.ecs.domain.Platform;
import com.thoughtworks.gocd.elasticagent.ecs.domain.PluginSettings;
import org.apache.commons.lang3.StringUtils;

import static com.thoughtworks.gocd.elasticagent.ecs.ECSElasticPlugin.LOG;
import static java.text.MessageFormat.format;
Expand All @@ -31,7 +32,7 @@ public RegisterTaskDefinitionRequest build(PluginSettings pluginSettings, Elasti

final RegisterTaskDefinitionRequest request = new RegisterTaskDefinitionRequest()
.withContainerDefinitions(containerDefinition)
.withTaskRoleArn(elasticAgentProfileProperties.getTaskRoleArn());
.withTaskRoleArn(StringUtils.defaultIfBlank(elasticAgentProfileProperties.getTaskRoleArn(), null));

if (elasticAgentProfileProperties.platform() == Platform.WINDOWS) {
return request;
Expand Down

0 comments on commit 01ebeeb

Please sign in to comment.