Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix condition in lambda deploy template #326

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

negillett
Copy link
Member

Previously, the EnableKeyGroup condition in exodus-lambda-deploy.yaml
checked that a joined list of keyids was an empty string. However, the
default value of keyids is the string "None", so the joined keyids
string will never be "".

The failure of this condition meant that an attempt was made to create
a KeyGroup resource even when no valid IDs existed.

This commit corrects the condition to look for the string "None".

Previously, the EnableKeyGroup condition in exodus-lambda-deploy.yaml
checked that a joined list of keyids was an empty string. However, the
default value of keyids is the string "None", so the joined keyids
string will never be "".

The failure of this condition meant that an attempt was made to create
a KeyGroup resource even when no valid IDs existed.

This commit corrects the condition to look for the string "None".
- !Join ["", !Ref keyids]
- ""
EnableKeyGroup:
!Not [!Equals [!Join ["", !Ref keyids], None]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably works but maybe the default value should be an empty list? Not sure how that looks for CommaDelimitedList, perhaps "". For a list of key IDs, "empty list" seems a better default value than either a string "None" or an actual None/null.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, any string will work but None is already used in the template for default values so I stuck with that.

It doesn't really make sense as a default for any of the other parameters either. Maybe we should follow up with a PR to update them all.

@dichn
Copy link
Collaborator

dichn commented Mar 14, 2022

I was actually preferring the following format. But I don't object to this fix if it works.

Conditions:
  EnableKeyGroup: !Not
    - !Equals
      - !Join ["", !Ref keyids]
      - None

@negillett negillett merged commit 9842120 into release-engineering:master Mar 14, 2022
@negillett negillett deleted the fix-deploy branch March 14, 2022 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants