Skip to content

Commit

Permalink
reword error message, clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviassss authored and jdn5126 committed Dec 11, 2023
1 parent 20051ce commit 71235d6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/aws-vpc-cni/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,11 @@ func validateEnvVars() bool {
return false
}

// Note that these string values should probably be cast to integers, but the comparison for values greater than 0 works either way
if prefixDelegationEn && (warmIPTarget <= 0 && warmPrefixTarget <= 0 && minimumIPTarget <= 0) {
if prefixDelegationEn && (warmIPTarget == 0 && warmPrefixTarget == 0 && minimumIPTarget == 0) {
log.Errorf("Setting WARM_PREFIX_TARGET = 0 is not supported while WARM_IP_TARGET/MINIMUM_IP_TARGET is not set. Please configure either one of the WARM_{PREFIX/IP}_TARGET or MINIMUM_IP_TARGET env variables")
return false
} else if inputWarmIP == "" && inputMinIP != "" {
log.Errorf("WARM_IP_TARGET should be set while MINIMUM_IP_TARGET is set, in order to avoid no new ENIs being allocated after minimum threshold is meet, please configure properly")
log.Errorf("WARM_IP_TARGET MUST be set when MINIMUM_IP_TARGET is set. Please configure both environment variables.")
return false
}
return true
Expand Down

0 comments on commit 71235d6

Please sign in to comment.