Skip to content

fix(cli): Correctly set NoLSI field when askDynamoLSIConfig returns false#1057

Merged
mergify[bot] merged 7 commits intoaws:masterfrom
bvtujo:set-noLsi
Jun 26, 2020
Merged

fix(cli): Correctly set NoLSI field when askDynamoLSIConfig returns false#1057
mergify[bot] merged 7 commits intoaws:masterfrom
bvtujo:set-noLsi

Conversation

@bvtujo
Copy link
Copy Markdown
Contributor

@bvtujo bvtujo commented Jun 26, 2020

This change solves an issue where if a customer selected "No" when asked "Would you like to add any alternate sort keys to this DynamoDB table?", the noLsi option was not properly set and an erroneous line was injected into the CF template.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@bvtujo bvtujo requested a review from a team as a code owner June 26, 2020 17:48
@bvtujo bvtujo requested a review from kohidave June 26, 2020 17:48
Comment thread internal/pkg/cli/storage_init_test.go Outdated
@bvtujo bvtujo added the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Jun 26, 2020
@bvtujo bvtujo removed the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Jun 26, 2020
@bvtujo bvtujo requested a review from iamhopaul123 June 26, 2020 18:00
Copy link
Copy Markdown
Contributor

@iamhopaul123 iamhopaul123 left a comment

Choose a reason for hiding this comment

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

ship it! Thanks for the quick turnaround.

Comment on lines +407 to 414
if !moreLSI {
if len(o.lsiSorts) == 0 {
o.noLsi = true
} else {
o.noLsi = false
}
break
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we have:

Suggested change
if !moreLSI {
if len(o.lsiSorts) == 0 {
o.noLsi = true
} else {
o.noLsi = false
}
break
}
if !moreLSI {
o.noLsi = len(o.lsiSorts) == 0
return nil
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

@efekarakus efekarakus left a comment

Choose a reason for hiding this comment

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

awesome, thank you!

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.

4 participants