Skip to content

Commit b3190d9

Browse files
committed
Add oem to accepted url schemes
Flatcar docs talk about `oem` url add it so ignition-validate does not fail. see: coreos/butane#634
1 parent 29861e8 commit b3190d9

15 files changed

Lines changed: 93 additions & 7 deletions

File tree

config/v3_0/types/url.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func validateURL(s string) error {
3030
}
3131

3232
switch u.Scheme {
33-
case "http", "https", "tftp":
33+
case "http", "https", "tftp", "oem":
3434
return nil
3535
case "s3":
3636
if v, ok := u.Query()["versionId"]; ok {

config/v3_0/types/url_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ func TestURLValidate(t *testing.T) {
6666
util.StrToPtr("s3://bucket/key?versionId=aVersionHash"),
6767
nil,
6868
},
69+
{
70+
util.StrToPtr("oem:///example.txt"),
71+
nil,
72+
},
73+
{
74+
util.StrToPtr("oem:///scripts/setup.sh"),
75+
nil,
76+
},
77+
{
78+
util.StrToPtr("oem:///etc/custom.conf"),
79+
nil,
80+
},
6981
}
7082

7183
for i, test := range tests {

config/v3_1/types/url.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func validateURL(s string) error {
3030
}
3131

3232
switch u.Scheme {
33-
case "http", "https", "tftp":
33+
case "http", "https", "tftp", "oem":
3434
return nil
3535
case "s3":
3636
if v, ok := u.Query()["versionId"]; ok {

config/v3_1/types/url_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ func TestURLValidate(t *testing.T) {
6666
util.StrToPtr("s3://bucket/key?versionId=aVersionHash"),
6767
nil,
6868
},
69+
{
70+
util.StrToPtr("oem:///example.txt"),
71+
nil,
72+
},
73+
{
74+
util.StrToPtr("oem:///scripts/setup.sh"),
75+
nil,
76+
},
77+
{
78+
util.StrToPtr("oem:///etc/custom.conf"),
79+
nil,
80+
},
6981
}
7082

7183
for i, test := range tests {

config/v3_2/types/url.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func validateURL(s string) error {
3030
}
3131

3232
switch u.Scheme {
33-
case "http", "https", "tftp", "gs":
33+
case "http", "https", "tftp", "gs", "oem":
3434
return nil
3535
case "s3":
3636
if v, ok := u.Query()["versionId"]; ok {

config/v3_2/types/url_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ func TestURLValidate(t *testing.T) {
7070
util.StrToPtr("gs://bucket/object"),
7171
nil,
7272
},
73+
{
74+
util.StrToPtr("oem:///example.txt"),
75+
nil,
76+
},
77+
{
78+
util.StrToPtr("oem:///scripts/setup.sh"),
79+
nil,
80+
},
81+
{
82+
util.StrToPtr("oem:///etc/custom.conf"),
83+
nil,
84+
},
7385
}
7486

7587
for i, test := range tests {

config/v3_3/types/url.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func validateURL(s string) error {
3030
}
3131

3232
switch u.Scheme {
33-
case "http", "https", "tftp", "gs":
33+
case "http", "https", "tftp", "gs", "oem":
3434
return nil
3535
case "s3":
3636
if v, ok := u.Query()["versionId"]; ok {

config/v3_3/types/url_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ func TestURLValidate(t *testing.T) {
7070
util.StrToPtr("gs://bucket/object"),
7171
nil,
7272
},
73+
{
74+
util.StrToPtr("oem:///example.txt"),
75+
nil,
76+
},
77+
{
78+
util.StrToPtr("oem:///scripts/setup.sh"),
79+
nil,
80+
},
81+
{
82+
util.StrToPtr("oem:///etc/custom.conf"),
83+
nil,
84+
},
7385
}
7486

7587
for i, test := range tests {

config/v3_4/types/url.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func validateURL(s string) error {
3232
}
3333

3434
switch u.Scheme {
35-
case "http", "https", "tftp", "gs":
35+
case "http", "https", "tftp", "gs", "oem":
3636
return nil
3737
case "s3":
3838
if v, ok := u.Query()["versionId"]; ok {

config/v3_4/types/url_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,18 @@ func TestURLValidate(t *testing.T) {
126126
util.StrToPtr("gs://bucket/object"),
127127
nil,
128128
},
129+
{
130+
util.StrToPtr("oem:///example.txt"),
131+
nil,
132+
},
133+
{
134+
util.StrToPtr("oem:///scripts/setup.sh"),
135+
nil,
136+
},
137+
{
138+
util.StrToPtr("oem:///etc/custom.conf"),
139+
nil,
140+
},
129141
}
130142

131143
for i, test := range tests {

0 commit comments

Comments
 (0)