-
Notifications
You must be signed in to change notification settings - Fork 21
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(cmd): Out of Bounds int32 Check in AWS Lambda Autoscale #238
Conversation
cmd/aws/lambda/autoscale/main.go
Outdated
@@ -63,7 +63,11 @@ func init() { | |||
panic(err) | |||
} | |||
|
|||
kinesisDownscaleDatapoints = int32(dps) | |||
if dps <= 360 && dps >= 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The max value can be any integer, so I think borrowing this logic from your first commit may work better:
if dps <= math.MaxInt32 && dps >= 1 {
Same for the other line, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, adjusted - i was basing off of the readme-defined maxes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that README might have been accurate at one time, but not anymore. It could use an update.
Description
Motivation and Context
Solves potential overflow issue if the Kinesis downscale and upscale datapoints values are outside the upper bound for int32. This occurs in init - failure should occur pre-runtime if the env var(s) are set incorrectly.
How Has This Been Tested?
N/A
Types of changes
Checklist: