@@ -93,7 +93,7 @@ func NewHelmGenerator(name string, fsys fs.FS, chartPath string, client client.C
9393 return nil , err
9494 }
9595
96- crds , err := find (fsys , chartPath + "/crds" , "*.yaml" , fileTypeRegular , 0 )
96+ crds , err := find (fsys , filepath . Clean ( chartPath + "/crds" ) , "*.yaml" , fileTypeRegular , 0 )
9797 if err != nil {
9898 return nil , err
9999 }
@@ -105,12 +105,12 @@ func NewHelmGenerator(name string, fsys fs.FS, chartPath string, client client.C
105105 g .crds = append (g .crds , raw )
106106 }
107107
108- includes , err := find (fsys , chartPath + "/templates" , "_*" , fileTypeRegular , 0 )
108+ includes , err := find (fsys , filepath . Clean ( chartPath + "/templates" ) , "_*" , fileTypeRegular , 0 )
109109 if err != nil {
110110 return nil , err
111111 }
112112
113- manifests , err := find (fsys , chartPath + "/templates" , "[^_]*.yaml" , fileTypeRegular , 0 )
113+ manifests , err := find (fsys , filepath . Clean ( chartPath + "/templates" ) , "[^_]*.yaml" , fileTypeRegular , 0 )
114114 if err != nil {
115115 return nil , err
116116 }
@@ -120,7 +120,7 @@ func NewHelmGenerator(name string, fsys fs.FS, chartPath string, client client.C
120120
121121 // TODO: for now, one level of library subcharts is supported
122122 // we should enhance the support of subcharts (nested charts, application charts)
123- subChartPaths , err := find (fsys , chartPath + "/charts" , "*" , fileTypeDir , 1 )
123+ subChartPaths , err := find (fsys , filepath . Clean ( chartPath + "/charts" ) , "*" , fileTypeDir , 1 )
124124 if err != nil {
125125 return nil , err
126126 }
@@ -136,7 +136,7 @@ func NewHelmGenerator(name string, fsys fs.FS, chartPath string, client client.C
136136 if subChartData .Type != helm .ChartTypeLibrary {
137137 return nil , fmt .Errorf ("only library subcharts are supported (path: %s)" , subChartPath )
138138 }
139- subIncludes , err := find (fsys , subChartPath + "/templates" , "_*" , fileTypeRegular , 0 )
139+ subIncludes , err := find (fsys , filepath . Clean ( subChartPath + "/templates" ) , "_*" , fileTypeRegular , 0 )
140140 if err != nil {
141141 return nil , err
142142 }
0 commit comments