Merge pull request #283 from manavellamnimble/fixFilePath

Filepath fixed
This commit is contained in:
Marc Campbell
2020-10-14 19:02:41 -07:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ package collect
import (
"encoding/json"
"path/filepath"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/version"
@@ -23,8 +24,8 @@ func ClusterInfo(c *Collector) (map[string][]byte, error) {
// cluster version
clusterVersion, clusterErrors := clusterVersion(client)
clusterInfoOutput["cluster-info/cluster_version.json"] = clusterVersion
clusterInfoOutput["cluster-info/errors.json"], err = marshalNonNil(clusterErrors)
clusterInfoOutput[filepath.Join("cluster-info", "cluster_version.json")] = clusterVersion
clusterInfoOutput[filepath.Join("cluster-info", "errors.json")], err = marshalNonNil(clusterErrors)
if err != nil {
return nil, errors.Wrap(err, "failed to marshal errors")
}

View File

@@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"path"
"path/filepath"
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
@@ -37,10 +36,10 @@ func Secret(c *Collector, secretCollector *troubleshootv1beta2.Secret) (map[stri
if err != nil {
return nil, err
}
secretOutput[path.Join("secrets-errors", filePath)] = errorBytes
secretOutput[filepath.Join("secrets-errors", filePath)] = errorBytes
}
if encoded != nil {
secretOutput[path.Join("secrets", filePath)] = encoded
secretOutput[filepath.Join("secrets", filePath)] = encoded
}
return secretOutput, nil