You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
providers/aws/ec2: getDurationValue silently defaults unknown RI terms to 1yr #33
Found during the LeanerCloud/cloud-commitments-cli#1207 pre-merge review (pre-existing, same bug class LeanerCloud/cloud-commitments-cli#1207 fixes in 5 other clients but out of its arch-04 scope): providers/aws/services/ec2/client.go ~line 630, getDurationValue silently defaults an unrecognized term string to the 1-year duration and feeds buildEC2OfferingQuery on the EC2 RI purchase path - a silent money-path fallback (could purchase a 1yr RI when the config said something else). Fix like LeanerCloud/cloud-commitments-cli#1207: return an explicit error on every unrecognized/empty term, propagate before any API call, regression test with real bad-term inputs ('', '0', '2yr', garbage) proving fail-before/pass-after. Note: SP's normalizeTermString defaults are currently gated upstream by fail-loud convertTermToSeconds - verify and leave a guard test if so. Per feedback_no_silent_fallbacks.
Verification sweep against main (101f099fb) on 2026-07-27 finds this already resolved.
EC2's getDurationValue now returns an explicit error on an unrecognized term instead of silently defaulting to 1yr.
Evidence: commit c59c11693 (PR LeanerCloud/cloud-commitments-cli#1481).
Recommending close.
Activity
cristim commentedon Jul 27, 2026
Verification sweep against
main(101f099fb) on 2026-07-27 finds this already resolved.EC2's getDurationValue now returns an explicit error on an unrecognized term instead of silently defaulting to 1yr.
Evidence: commit c59c11693 (PR LeanerCloud/cloud-commitments-cli#1481).
Recommending close.