Skip to content

Commit 2020049

Browse files
authored
Merge pull request #283 from manavellamnimble/fixFilePath
Filepath fixed
2 parents d94954e + 06817c1 commit 2020049

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/collect/cluster_info.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package collect
22

33
import (
44
"encoding/json"
5+
"path/filepath"
56

67
"github.com/pkg/errors"
78
"k8s.io/apimachinery/pkg/version"
@@ -23,8 +24,8 @@ func ClusterInfo(c *Collector) (map[string][]byte, error) {
2324

2425
// cluster version
2526
clusterVersion, clusterErrors := clusterVersion(client)
26-
clusterInfoOutput["cluster-info/cluster_version.json"] = clusterVersion
27-
clusterInfoOutput["cluster-info/errors.json"], err = marshalNonNil(clusterErrors)
27+
clusterInfoOutput[filepath.Join("cluster-info", "cluster_version.json")] = clusterVersion
28+
clusterInfoOutput[filepath.Join("cluster-info", "errors.json")], err = marshalNonNil(clusterErrors)
2829
if err != nil {
2930
return nil, errors.Wrap(err, "failed to marshal errors")
3031
}

pkg/collect/secret.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7-
"path"
87
"path/filepath"
98

109
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
@@ -37,10 +36,10 @@ func Secret(c *Collector, secretCollector *troubleshootv1beta2.Secret) (map[stri
3736
if err != nil {
3837
return nil, err
3938
}
40-
secretOutput[path.Join("secrets-errors", filePath)] = errorBytes
39+
secretOutput[filepath.Join("secrets-errors", filePath)] = errorBytes
4140
}
4241
if encoded != nil {
43-
secretOutput[path.Join("secrets", filePath)] = encoded
42+
secretOutput[filepath.Join("secrets", filePath)] = encoded
4443
}
4544

4645
return secretOutput, nil

0 commit comments

Comments
 (0)