@@ -21,7 +21,6 @@ import (
21
21
"math/rand"
22
22
"net"
23
23
"os"
24
- "path"
25
24
"path/filepath"
26
25
"regexp"
27
26
"strings"
@@ -115,7 +114,7 @@ func (l DirectoryLister) ListChildDirs(parentDir string, test func(dir string) b
115
114
var dirs []string
116
115
for _ , dir := range fileInfos {
117
116
dirName := dir .Name ()
118
- parentSlashChildDir := path .Join (parentDir , dirName )
117
+ parentSlashChildDir := filepath .Join (parentDir , dirName )
119
118
if test (parentSlashChildDir ) {
120
119
dirs = append (dirs , parentSlashChildDir )
121
120
}
@@ -130,8 +129,8 @@ func (u ChartUtils) LookupChartDir(chartDirs []string, dir string) (string, erro
130
129
for _ , chartDir := range chartDirs {
131
130
currentDir := dir
132
131
for {
133
- chartYaml := path .Join (currentDir , "Chart.yaml" )
134
- parent := path .Dir (path .Dir (chartYaml ))
132
+ chartYaml := filepath .Join (currentDir , "Chart.yaml" )
133
+ parent := filepath .Dir (filepath .Dir (chartYaml ))
135
134
chartDir = strings .TrimRight (chartDir , "/" ) // remove any trailing slash from the dir
136
135
137
136
// check directory has a Chart.yaml and that it is in a
@@ -140,9 +139,9 @@ func (u ChartUtils) LookupChartDir(chartDirs []string, dir string) (string, erro
140
139
return currentDir , nil
141
140
}
142
141
143
- currentDir = path .Dir (currentDir )
142
+ currentDir = filepath .Dir (currentDir )
144
143
relativeDir , _ := filepath .Rel (chartDir , currentDir )
145
- joined := path .Join (chartDir , relativeDir )
144
+ joined := filepath .Join (chartDir , relativeDir )
146
145
if (joined == chartDir ) || strings .HasPrefix (relativeDir , ".." ) {
147
146
break
148
147
}
@@ -155,7 +154,7 @@ func (u ChartUtils) LookupChartDir(chartDirs []string, dir string) (string, erro
155
154
// and return a newly allocated ChartYaml object. If no Chart.yaml is present
156
155
// or there is an error unmarshaling the file contents, an error will be returned.
157
156
func ReadChartYaml (dir string ) (* ChartYaml , error ) {
158
- yamlBytes , err := ioutil .ReadFile (path .Join (dir , "Chart.yaml" ))
157
+ yamlBytes , err := ioutil .ReadFile (filepath .Join (dir , "Chart.yaml" ))
159
158
if err != nil {
160
159
return nil , errors .Wrap (err , "Could not read 'Chart.yaml'" )
161
160
}
0 commit comments