From 06817c16823e3f60571d942382e4ddac99e9ddb8 Mon Sep 17 00:00:00 2001 From: Matias Manavella Date: Wed, 14 Oct 2020 15:01:00 -0300 Subject: [PATCH] Filepath fixed --- pkg/collect/cluster_info.go | 5 +++-- pkg/collect/secret.go | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/collect/cluster_info.go b/pkg/collect/cluster_info.go index febf5bd1..4bc447b6 100644 --- a/pkg/collect/cluster_info.go +++ b/pkg/collect/cluster_info.go @@ -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") } diff --git a/pkg/collect/secret.go b/pkg/collect/secret.go index 5fab9b53..fa740b21 100644 --- a/pkg/collect/secret.go +++ b/pkg/collect/secret.go @@ -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