Skip to content

Commit dee12ad

Browse files
committed
fix: fix for #1835
1 parent f753168 commit dee12ad

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

pkg/devspace/config/loader/loader.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ package loader
22

33
import (
44
"fmt"
5-
"github.com/loft-sh/devspace/pkg/util/constraint"
65
"io/ioutil"
76
"os"
87
"os/exec"
98
"path/filepath"
109
"regexp"
1110
"strings"
1211

12+
"github.com/loft-sh/devspace/pkg/util/constraint"
13+
1314
"github.com/loft-sh/devspace/pkg/devspace/plugin"
1415
"github.com/loft-sh/devspace/pkg/devspace/upgrade"
1516

@@ -422,10 +423,6 @@ func validateProfile(profile interface{}) error {
422423
}
423424

424425
for idx, patch := range profileConfig.Patches {
425-
if vars.VarMatchRegex.MatchString(patch.Path) {
426-
return fmt.Errorf("patches[%d] path cannot be a variable", idx)
427-
}
428-
429426
if expression.ExpressionMatchRegex.MatchString(patch.Path) {
430427
return fmt.Errorf("patches[%d] path cannot be an expression", idx)
431428
}

pkg/devspace/config/loader/loader_test.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,37 +1127,6 @@ profiles:
11271127
},
11281128
},
11291129
},
1130-
"Profile with patch path variable": {
1131-
in: &parseTestCaseInput{
1132-
config: `
1133-
version: v1beta11
1134-
deployments:
1135-
- name: deployment
1136-
helm:
1137-
componentChart: true
1138-
values:
1139-
containers:
1140-
- image: nginx
1141-
profiles:
1142-
- name: testprofile
1143-
patches:
1144-
- path: ${path}
1145-
op: replace
1146-
value:
1147-
- name: deployment
1148-
helm:
1149-
componentChart: true
1150-
values:
1151-
containers:
1152-
- image: ubuntu
1153-
`,
1154-
options: &ConfigOptions{Profiles: []string{"testprofile"}},
1155-
generatedConfig: &generated.Config{Vars: map[string]string{
1156-
"path": "deployments",
1157-
}},
1158-
},
1159-
expectedErr: "error validating profiles[0]: patches[0] path cannot be a variable",
1160-
},
11611130
"Profile with patch path expression": {
11621131
in: &parseTestCaseInput{
11631132
config: `

0 commit comments

Comments
 (0)