From 172ecbac00ba866025984278c54e9412ca879fc5 Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Tue, 12 Oct 2021 10:44:40 -0500 Subject: [PATCH] Unmarshal changes --- pkg/config/autodiscover/autodiscover.go | 3 +-- pkg/config/autodiscover/csv_info.go | 3 +-- pkg/config/autodiscover/pod_info.go | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/config/autodiscover/autodiscover.go b/pkg/config/autodiscover/autodiscover.go index c0c0a40b9..64291374f 100644 --- a/pkg/config/autodiscover/autodiscover.go +++ b/pkg/config/autodiscover/autodiscover.go @@ -17,7 +17,6 @@ package autodiscover import ( - "encoding/json" "fmt" "os" "path" @@ -106,7 +105,7 @@ func executeOcGetCommand(resourceType, labelQuery, namespace string) (string, er matches := genericTest.Matches gomega.Expect(len(matches)).To(gomega.Equal(1)) match := genericTest.GetMatches()[0] - err = json.Unmarshal([]byte(match.Match), &commandDriver) + err = jsonUnmarshal([]byte(match.Match), &commandDriver) gomega.Expect(err).To(gomega.BeNil()) return match.Match, err } diff --git a/pkg/config/autodiscover/csv_info.go b/pkg/config/autodiscover/csv_info.go index dcc82e382..74fcdfa6d 100644 --- a/pkg/config/autodiscover/csv_info.go +++ b/pkg/config/autodiscover/csv_info.go @@ -17,7 +17,6 @@ package autodiscover import ( - "encoding/json" "fmt" log "github.com/sirupsen/logrus" @@ -80,7 +79,7 @@ func GetCSVsByLabel(labelName, labelValue, namespace string) (*CSVList, error) { log.Debug("Command: ", out) var csvList CSVList - err = json.Unmarshal([]byte(out), &csvList) + err = jsonUnmarshal([]byte(out), &csvList) if err != nil { return nil, err } diff --git a/pkg/config/autodiscover/pod_info.go b/pkg/config/autodiscover/pod_info.go index 19e41867c..43355ef3d 100644 --- a/pkg/config/autodiscover/pod_info.go +++ b/pkg/config/autodiscover/pod_info.go @@ -17,7 +17,6 @@ package autodiscover import ( - "encoding/json" "fmt" log "github.com/sirupsen/logrus" @@ -163,7 +162,7 @@ func GetPodsByLabel(label configsections.Label, namespace string) (*PodList, err log.Debug("Command: ", out) var podList PodList - err = json.Unmarshal([]byte(out), &podList) + err = jsonUnmarshal([]byte(out), &podList) if err != nil { return nil, err }