Browse Source

Propagate errors on reading pages of GCP pricing data, rather than
swallowing them and looping indefinitely as shown in https://github.com/kubecost/cost-model/issues/1125

Neal Ormsbee 4 years ago
parent
commit
2f1c285a5c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      pkg/cloud/gcpprovider.go

+ 2 - 0
pkg/cloud/gcpprovider.go

@@ -451,6 +451,8 @@ func (gcp *GCP) parsePage(r io.Reader, inputKeys map[string]Key, pvKeys map[stri
 		t, err := dec.Token()
 		if err == io.EOF {
 			break
+		} else if err != nil {
+			return nil, "", fmt.Errorf("Error parsing GCP pricing page: %s", err)
 		}
 		if t == "skus" {
 			_, err := dec.Token() // consumes [