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 13, 2023
1 parent 2e629ff commit bd1b0cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/installer/kubernetes.go
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 bd1b0cf

Please sign in to comment.