mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
fix yaml parsing (#330)
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
package objects
|
package objects
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -14,11 +14,11 @@ import (
|
|||||||
"github.com/komodorio/helm-dashboard/pkg/dashboard/subproc"
|
"github.com/komodorio/helm-dashboard/pkg/dashboard/subproc"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"gopkg.in/yaml.v3"
|
|
||||||
"helm.sh/helm/v3/pkg/action"
|
"helm.sh/helm/v3/pkg/action"
|
||||||
"helm.sh/helm/v3/pkg/cli"
|
"helm.sh/helm/v3/pkg/cli"
|
||||||
"helm.sh/helm/v3/pkg/release"
|
"helm.sh/helm/v3/pkg/release"
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/testapigroup/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/testapigroup/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/util/yaml"
|
||||||
"k8s.io/client-go/tools/clientcmd"
|
"k8s.io/client-go/tools/clientcmd"
|
||||||
//"sigs.k8s.io/yaml"
|
//"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
@@ -103,8 +103,7 @@ func (d *DataLayer) GetStatus() *StatusInfo {
|
|||||||
type SectionFn = func(*release.Release, bool) (string, error)
|
type SectionFn = func(*release.Release, bool) (string, error)
|
||||||
|
|
||||||
func ParseManifests(out string) ([]*v1.Carp, 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)
|
res := make([]*v1.Carp, 0)
|
||||||
var tmp interface{}
|
var tmp interface{}
|
||||||
for {
|
for {
|
||||||
|
|||||||
Reference in New Issue
Block a user