Skip to content

fix(cli): reject Count=0 and negative EstimatedSavings in CSV input #2116

Description

@cristim

From the review of #2114 (closes #1944). cmd/multi_service_csv.go ~185 still accepts an explicit Count of 0: it buys nothing but triggers a live purchase call ('About to buy 0 instances') that only AWS rejects (there's a provider zero guard for EC2 only). Change the check to n < 1 ('must be at least 1') and add a zero case to TestLoadRecommendationsFromCSV_StrictCount. The tool's own CSVs never emit 0 (the SP client sets Count: 1). Also reject a negative EstimatedSavings (~201), and stop printing the bad value twice in parse errors (%q plus a wrapped strconv.NumError, ~182/199).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions