Skip to content

Commit

Permalink
fix: disable csv fields count validation when listing contexts in k8s (
Browse files Browse the repository at this point in the history
  • Loading branch information
mathnogueira committed Jun 14, 2023
1 parent 0c2e259 commit e85da3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/installer/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ func getKubernetesContextArray(kubeconfig string) ([][]string, error) {
newStringBytes := spaceRegex.ReplaceAll([]byte(output), []byte(","))
output = string(newStringBytes)

records, err := csv.NewReader(strings.NewReader(output)).ReadAll()
csvReader := csv.NewReader(strings.NewReader(output))
// Related to issue: https://github.com/kubeshop/tracetest/issues/2723
csvReader.FieldsPerRecord = -1 // Disable fields length validation
records, err := csvReader.ReadAll()
if err != nil {
return [][]string{}, err
}
Expand Down

0 comments on commit e85da3b

Please sign in to comment.