@@ -3,13 +3,14 @@ package variable
33import (
44 "context"
55 "fmt"
6+ "path/filepath"
7+ "regexp"
8+ "strings"
9+
610 "github.com/loft-sh/devspace/pkg/devspace/config/loader/variable/expression"
711 "github.com/loft-sh/devspace/pkg/devspace/config/loader/variable/runtime"
812 "github.com/loft-sh/devspace/pkg/devspace/config/localcache"
913 "github.com/loft-sh/devspace/pkg/devspace/dependency/graph"
10- "path/filepath"
11- "regexp"
12- "strings"
1314
1415 "github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
1516 "github.com/loft-sh/devspace/pkg/devspace/deploy/deployer/kubectl/walk"
@@ -233,8 +234,8 @@ func (r *resolver) insertVariableGraph(g *graph.Graph, node *latest.Variable) er
233234func (r * resolver ) FillVariablesInclude (ctx context.Context , haystack interface {}, includedPaths []string ) (interface {}, error ) {
234235 paths := []* regexp.Regexp {}
235236 for _ , path := range includedPaths {
236- path = strings .Replace (path , "*" , "[^/]+" , - 1 )
237- path = strings .Replace (path , "**" , ".+" , - 1 )
237+ path = strings .ReplaceAll (path , "*" , "[^/]+" )
238+ path = strings .ReplaceAll (path , "**" , ".+" )
238239 path = "^" + path
239240 expr , err := regexp .Compile (path )
240241 if err != nil {
@@ -263,8 +264,8 @@ func (r *resolver) FillVariablesInclude(ctx context.Context, haystack interface{
263264func (r * resolver ) FillVariablesExclude (ctx context.Context , haystack interface {}, excludedPaths []string ) (interface {}, error ) {
264265 paths := []* regexp.Regexp {}
265266 for _ , path := range excludedPaths {
266- path = strings .Replace (path , "*" , "[^/]+" , - 1 )
267- path = strings .Replace (path , "**" , ".+" , - 1 )
267+ path = strings .ReplaceAll (path , "*" , "[^/]+" )
268+ path = strings .ReplaceAll (path , "**" , ".+" )
268269 path = "^" + path
269270 expr , err := regexp .Compile (path )
270271 if err != nil {
0 commit comments