Skip to content

Commit

Permalink
fix(aws): Fixed bug to use spotMaxPrice conditionally (#5229)
Browse files Browse the repository at this point in the history
Co-authored-by: Datta-Kumar <kprathib@147dda5ecaee.ant.amazon.com>
  • Loading branch information
pdk27 and Datta-Kumar committed Feb 3, 2021
1 parent f4b73d6 commit dad7bd9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

@Slf4j
public class LaunchTemplateService {
Expand Down Expand Up @@ -332,7 +333,7 @@ private void setCreditSpecification(
*/
private void setSpotInstanceMarketOptions(
RequestLaunchTemplateData request, String maxSpotPrice) {
if (maxSpotPrice != null) {
if (maxSpotPrice != null && StringUtils.isNotEmpty(maxSpotPrice.trim())) {
request.setInstanceMarketOptions(
new LaunchTemplateInstanceMarketOptionsRequest()
.withMarketType("spot")
Expand Down

0 comments on commit dad7bd9

Please sign in to comment.