diff options
author | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-04-16 18:09:13 -0700 |
---|---|---|
committer | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-04-16 18:09:27 -0700 |
commit | bf49d552b003072c6bc64ae838a4699c1f4028bd (patch) | |
tree | 57c2b6130781f8215b0544e6b6f126ec8e2f8152 /src/k8splugin/internal/helm/helm_test.go | |
parent | 244578803033f17781b10be283aef43fa6f0aa60 (diff) |
Replace Kind with GroupVersionKind
Kind is not unique to track resources in Kubernetes
GroupVersionKind is unique. We are just using that to
track our data. It is abstracted behind a couple of new
types for templates and resources.
This change makes a lot of the old kind based operations
redundant and simplified.
Issue-ID: MULTICLOUD-573
Change-Id: I8f4ded2ba6a0821a8fbd679dc99ce3a44d805524
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/internal/helm/helm_test.go')
-rw-r--r-- | src/k8splugin/internal/helm/helm_test.go | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/k8splugin/internal/helm/helm_test.go b/src/k8splugin/internal/helm/helm_test.go index 27bb9d79..a13c67ba 100644 --- a/src/k8splugin/internal/helm/helm_test.go +++ b/src/k8splugin/internal/helm/helm_test.go @@ -165,27 +165,26 @@ func TestGenerateKubernetesArtifacts(t *testing.T) { } else { //Compute the hash of returned data and compare for _, v := range out { - for _, f := range v { - data, err := ioutil.ReadFile(f) - if err != nil { - t.Errorf("Unable to read file %s", v) - } - h.Write(data) - gotHash := fmt.Sprintf("%x", h.Sum(nil)) - h.Reset() + f := v.FilePath + data, err := ioutil.ReadFile(f) + if err != nil { + t.Errorf("Unable to read file %s", v) + } + h.Write(data) + gotHash := fmt.Sprintf("%x", h.Sum(nil)) + h.Reset() - //Find the right hash from expectedHashMap - expectedHash := "" - for k1, v1 := range testCase.expectedHashMap { - if strings.Contains(f, k1) == true { - expectedHash = v1 - break - } - } - if gotHash != expectedHash { - t.Fatalf("Got unexpected hash for %s", f) + //Find the right hash from expectedHashMap + expectedHash := "" + for k1, v1 := range testCase.expectedHashMap { + if strings.Contains(f, k1) == true { + expectedHash = v1 + break } } + if gotHash != expectedHash { + t.Fatalf("Got unexpected hash for %s", f) + } } } }) |