From dd1fe05d65ac5e52209ca227371faf9c480d1f29 Mon Sep 17 00:00:00 2001 From: Itiel shwartz Date: Tue, 11 Apr 2023 19:06:42 +0300 Subject: [PATCH] fix yaml parsing (#330) --- pkg/dashboard/objects/data.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/dashboard/objects/data.go b/pkg/dashboard/objects/data.go index 7d9857e..81a372b 100644 --- a/pkg/dashboard/objects/data.go +++ b/pkg/dashboard/objects/data.go @@ -1,10 +1,10 @@ package objects import ( - "bytes" "context" "encoding/json" "os" + "strings" "sync" "time" @@ -14,11 +14,11 @@ import ( "github.com/komodorio/helm-dashboard/pkg/dashboard/subproc" "github.com/pkg/errors" log "github.com/sirupsen/logrus" - "gopkg.in/yaml.v3" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/cli" "helm.sh/helm/v3/pkg/release" v1 "k8s.io/apimachinery/pkg/apis/testapigroup/v1" + "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/client-go/tools/clientcmd" //"sigs.k8s.io/yaml" ) @@ -103,8 +103,7 @@ func (d *DataLayer) GetStatus() *StatusInfo { type SectionFn = func(*release.Release, bool) (string, error) func ParseManifests(out string) ([]*v1.Carp, error) { - dec := yaml.NewDecoder(bytes.NewReader([]byte(out))) - + dec := yaml.NewYAMLOrJSONDecoder(strings.NewReader(out), 4096) res := make([]*v1.Carp, 0) var tmp interface{} for {