@@ -86,7 +86,7 @@ pipelineTemplates:
8686 namespace: [[ argocdNamespace ]] # you can use global vars in templates
8787 destination:
8888 server: https://kubernetes.default.svc
89- namespace: default
89+ namespace: devstream-io
9090 source:
9191 valuefile: values.yaml
9292 path: helm/[[ app ]]
@@ -128,6 +128,10 @@ var _ = Describe("LoadConfig", func() {
128128 Options : RawOptions {
129129 "instanceID" : "service-a" ,
130130 "pipeline" : RawOptions {
131+ "language" : RawOptions {
132+ "name" : "python" ,
133+ "framework" : "django" ,
134+ },
131135 "docker" : RawOptions {
132136 "registry" : RawOptions {
133137 "repository" : "service-a" ,
@@ -159,28 +163,17 @@ var _ = Describe("LoadConfig", func() {
159163 },
160164 Options : RawOptions {
161165 "instanceID" : "service-a" ,
162- "pipeline" : RawOptions {
163- "destination" : RawOptions {
164- "namespace" : "devstream-io" ,
165- "server" : "https://kubernetes.default.svc" ,
166- },
167- "app" : RawOptions {
168- "namespace" : "argocd" ,
169- },
170- "source" : RawOptions {
171- "valuefile" : "values.yaml" ,
172- "path" : "helm/service-a" ,
173- "repoURL" : "${{repo-scaffolding.myapp.outputs.repoURL}}" ,
174- },
175- "configLocation" : "" ,
166+ "destination" : RawOptions {
167+ "namespace" : "devstream-io" ,
168+ "server" : "https://kubernetes.default.svc" ,
176169 },
177- "scm " : RawOptions {
178- "url " : "https://github.com/devstream-io/service-a " ,
179- "apiURL" : "gitlab.com/some/path/to/your/api" ,
180- "owner " : "devstream-io" ,
181- "org " : "devstream-io " ,
182- "name " : " service-a" ,
183- "scmType " : "github " ,
170+ "app " : RawOptions {
171+ "namespace " : "argocd " ,
172+ } ,
173+ "source " : RawOptions {
174+ "valuefile " : "values.yaml " ,
175+ "path " : "helm/ service-a" ,
176+ "repoURL " : "${{repo-scaffolding.myapp.outputs.repoURL}} " ,
184177 },
185178 },
186179 }
@@ -210,14 +203,7 @@ var _ = Describe("LoadConfig", func() {
210203 "repo" : "dtm-scaffolding-golang" ,
211204 "branch" : "main" ,
212205 },
213- "vars" : RawOptions {
214- "foo1" : "bar1" ,
215- "foo2" : "bar2" ,
216- "registryType" : "dockerhub" ,
217- "framework" : "django" ,
218- "language" : "python" ,
219- "argocdNamespace" : "argocd" ,
220- },
206+ "vars" : RawOptions {},
221207 },
222208 }
223209
@@ -273,17 +259,20 @@ var _ = Describe("LoadConfig", func() {
273259var _ = Describe ("escapeBrackets" , func () {
274260 When ("escape brackets" , func () {
275261 It ("should works right" , func () {
276- testStrBytes1 := "foo: [[ foo ]]\n "
277- testStr2 := "foo: xx[[ foo ]]\n "
278- testStr3 := "foo: [[ foo ]]xx\n "
279-
280- retStr1 := escapeBrackets ([]byte (testStrBytes1 ))
281- retStr2 := escapeBrackets ([]byte (testStr2 ))
282- retStr3 := escapeBrackets ([]byte (testStr3 ))
262+ testMap := map [string ]string {
263+ "foo: [[ foo ]]" : "foo: \" [[ foo ]]\" " ,
264+ "foo: [[ foo ]] #comment" : "foo: \" [[ foo ]]\" #comment" ,
265+ "foo: xx[[ foo ]]" : "foo: xx[[ foo ]]" ,
266+ "foo: [[ foo ]]xx" : "foo: \" [[ foo ]]xx\" " ,
267+ "foo: [[ foo ]]/[[ poo ]]" : "foo: \" [[ foo ]]/[[ poo ]]\" " ,
268+ `foo: [[ test ]]
269+ poo: [[ gg ]]` : "foo: \" [[ test ]]\" \n poo: \" [[ gg ]]\" " ,
270+ }
283271
284- Expect (string (retStr1 )).To (Equal ("foo: \" [[ foo ]]\" \n " ))
285- Expect (string (retStr2 )).To (Equal ("foo: xx[[ foo ]]\n " ))
286- Expect (string (retStr3 )).To (Equal ("foo: \" [[ foo ]]xx\" \n " ))
272+ for testStr , expectStr := range testMap {
273+ retStr1 := escapeBrackets ([]byte (testStr ))
274+ Expect (string (retStr1 )).Should (Equal (expectStr ))
275+ }
287276 })
288277 })
289278})
0 commit comments