@@ -23,67 +23,73 @@ type useAbsLocatorsTestCase struct {
2323var useAbsLocatorsTestCases = []useAbsLocatorsTestCase {
2424 {
2525 "Template without base or script file" ,
26- "template:// foo" ,
26+ "template:foo" ,
2727 `arch: aarch64` ,
2828 `arch: aarch64` ,
2929 },
3030 {
3131 "Single string base template" ,
32+ "template:foo" ,
33+ `base: bar.yaml` ,
34+ `base: template:bar.yaml` ,
35+ },
36+ {
37+ "Legacy template:// base template" ,
3238 "template://foo" ,
3339 `base: bar.yaml` ,
34- `base: template:// bar.yaml` ,
40+ `base: template:bar.yaml` ,
3541 },
3642 {
3743 "Flow style array of one base template" ,
38- "template:// foo" ,
44+ "template:foo" ,
3945 `base: [{url: bar.yaml, digest: deadbeef}]` ,
4046 // not sure why the quotes around the URL were added; maybe because we don't copy the style from the source
41- `base: [{url: 'template:// bar.yaml', digest: deadbeef}]` ,
47+ `base: [{url: 'template:bar.yaml', digest: deadbeef}]` ,
4248 },
4349 {
4450 "Flow style array of sequence of two base URLs" ,
45- "template:// foo" ,
51+ "template:foo" ,
4652 `base: [bar.yaml, baz.yaml]` ,
47- `base: ['template:// bar.yaml', 'template:// baz.yaml']` ,
53+ `base: ['template:bar.yaml', 'template:baz.yaml']` ,
4854 },
4955 {
5056 "Flow style array of sequence of two base locator objects" ,
51- "template:// foo" ,
57+ "template:foo" ,
5258 `base: [{url: bar.yaml, digest: deadbeef}, {url: baz.yaml, digest: decafbad}]` ,
53- `base: [{url: 'template:// bar.yaml', digest: deadbeef}, {url: 'template:// baz.yaml', digest: decafbad}]` ,
59+ `base: [{url: 'template:bar.yaml', digest: deadbeef}, {url: 'template:baz.yaml', digest: decafbad}]` ,
5460 },
5561 {
5662 "Block style array of one base template" ,
57- "template:// foo" ,
63+ "template:foo" ,
5864 `
5965base:
6066- bar.yaml
6167` ,
6268 `
6369base:
64- - template:// bar.yaml` ,
70+ - template:bar.yaml` ,
6571 },
6672 {
6773 "Block style of four base templates" ,
68- "template:// foo" ,
74+ "template:foo" ,
6975 `
7076base:
7177- bar.yaml
72- - template:// my
78+ - template:my
7379- https://example.com/my.yaml
7480- baz.yaml
7581` ,
7682 `
7783base:
78- - template:// bar.yaml
79- - template:// my
84+ - template:bar.yaml
85+ - template:my
8086- https://example.com/my.yaml
81- - template:// baz.yaml
87+ - template:baz.yaml
8288` ,
8389 },
8490 {
8591 "Provisioning and probe scripts" ,
86- "template:// experimental/foo" ,
92+ "template:experimental/foo" ,
8793 `
8894provision:
8995- mode: user
@@ -101,15 +107,15 @@ probes:
101107 `
102108provision:
103109- mode: user
104- file: template:// experimental/userscript.sh
110+ file: template:experimental/userscript.sh
105111- mode: system
106112 file:
107- url: template:// experimental/systemscript.sh
113+ url: template:experimental/systemscript.sh
108114 digest: abc123
109115probes:
110- - file: template:// experimental/probe.sh
116+ - file: template:experimental/probe.sh
111117- file:
112- url: template:// experimental/probe.sh
118+ url: template:experimental/probe.sh
113119 digest: digest
114120` ,
115121 },
@@ -153,15 +159,15 @@ func TestBasePath(t *testing.T) {
153159 })
154160
155161 t .Run ("" , func (t * testing.T ) {
156- actual , err := basePath ("template:// foo" )
162+ actual , err := basePath ("template:foo" )
157163 assert .NilError (t , err )
158- assert .Equal (t , actual , "template:// " )
164+ assert .Equal (t , actual , "template:" )
159165 })
160166
161167 t .Run ("" , func (t * testing.T ) {
162- actual , err := basePath ("template:// foo/bar" )
168+ actual , err := basePath ("template:foo/bar" )
163169 assert .NilError (t , err )
164- assert .Equal (t , actual , "template:// foo" )
170+ assert .Equal (t , actual , "template:foo" )
165171 })
166172
167173 t .Run ("" , func (t * testing.T ) {
@@ -216,9 +222,9 @@ func TestAbsPath(t *testing.T) {
216222 })
217223
218224 t .Run ("" , func (t * testing.T ) {
219- actual , err := absPath ("template:// foo" , volume + "/root" )
225+ actual , err := absPath ("template:foo" , volume + "/root" )
220226 assert .NilError (t , err )
221- assert .Equal (t , actual , "template:// foo" )
227+ assert .Equal (t , actual , "template:foo" )
222228 })
223229
224230 t .Run ("" , func (t * testing.T ) {
@@ -272,15 +278,15 @@ func TestAbsPath(t *testing.T) {
272278 }
273279
274280 t .Run ("" , func (t * testing.T ) {
275- actual , err := absPath ("foo" , "template:// " )
281+ actual , err := absPath ("foo" , "template:" )
276282 assert .NilError (t , err )
277- assert .Equal (t , actual , "template:// foo" )
283+ assert .Equal (t , actual , "template:foo" )
278284 })
279285
280286 t .Run ("" , func (t * testing.T ) {
281- actual , err := absPath ("bar" , "template:// foo" )
287+ actual , err := absPath ("bar" , "template:foo" )
282288 assert .NilError (t , err )
283- assert .Equal (t , actual , "template:// foo/bar" )
289+ assert .Equal (t , actual , "template:foo/bar" )
284290 })
285291
286292 t .Run ("" , func (t * testing.T ) {
0 commit comments