Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
add flag for skipping ami check that got dropped during refactor (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
fieldju authored Apr 10, 2018
1 parent 3d98c3d commit 0a7391d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

group=com.nike
artifactId=cerberus-lifecycle-cli
version=4.6.0
version=4.6.1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
import java.util.Map;

import static com.nike.cerberus.command.core.UpdateStackCommand.COMMAND_NAME;

import static com.nike.cerberus.ConfigConstants.SKIP_AMI_TAG_CHECK_ARG;
import static com.nike.cerberus.ConfigConstants.SKIP_AMI_TAG_CHECK_DESCRIPTION;

/**
* Command for updating the specified CloudFormation stack with the new parameters.
Expand Down Expand Up @@ -78,6 +79,14 @@ public String getCommandName() {
return COMMAND_NAME;
}

@Parameter(names = SKIP_AMI_TAG_CHECK_ARG,
description = SKIP_AMI_TAG_CHECK_DESCRIPTION)
private boolean skipAmiTagCheck;

public boolean isSkipAmiTagCheck() {
return skipAmiTagCheck;
}

@Override
public Class<? extends Operation<?>> getOperationClass() {
return UpdateStackOperation.class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void run(UpdateStackCommand command) {
Optional.ofNullable(tags.getOrDefault("ownerGroup", null))));
}

if (Stack.CMS.equals(command.getStack())) {
if (Stack.CMS.equals(command.getStack()) && ! command.isSkipAmiTagCheck()) {
command.getDynamicParameters().forEach((key, value) -> {
if (key.equals("amiId")) {
amiTagCheckService.validateAmiTagForStack(value, Stack.CMS);
Expand Down

0 comments on commit 0a7391d

Please sign in to comment.