File tree 2 files changed +2
-13
lines changed
2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"net/url"
6
6
"os"
7
- "path"
8
7
"path/filepath"
9
8
"strings"
10
9
@@ -104,20 +103,10 @@ func (d *DevfileCtx) Populate() (err error) {
104
103
105
104
// PopulateFromURL fills the DevfileCtx struct with relevant context info
106
105
func (d * DevfileCtx ) PopulateFromURL () (err error ) {
107
- u , err : = url .ParseRequestURI (d .url )
106
+ _ , err = url .ParseRequestURI (d .url )
108
107
if err != nil {
109
108
return err
110
109
}
111
- if ! strings .HasSuffix (d .url , ".yaml" ) {
112
- u .Path = path .Join (u .Path , "devfile.yaml" )
113
- if _ , err = util .DownloadFileInMemory (u .String ()); err != nil {
114
- u .Path = path .Join (path .Dir (u .Path ), ".devfile.yaml" )
115
- if _ , err = util .DownloadFileInMemory (u .String ()); err != nil {
116
- return fmt .Errorf ("the provided url is not a valid yaml filepath, and devfile.yaml or .devfile.yaml not found in the provided path : %s" , d .url )
117
- }
118
- }
119
- d .url = u .String ()
120
- }
121
110
if d .uriMap == nil {
122
111
d .uriMap = make (map [string ]bool )
123
112
}
Original file line number Diff line number Diff line change @@ -2390,7 +2390,7 @@ func Test_parseParentAndPlugin_RecursivelyReference_withMultipleURI(t *testing.T
2390
2390
defer testServer3 .Close ()
2391
2391
t .Run ("it should error out if URI is recursively referenced with multiple references" , func (t * testing.T ) {
2392
2392
err := parseParentAndPlugin (devFileObj )
2393
- expectedErr := fmt .Sprintf ("URI %v%v/devfile.yaml is recursively referenced" , httpPrefix , uri1 )
2393
+ expectedErr := fmt .Sprintf ("URI %v%v is recursively referenced" , httpPrefix , uri1 )
2394
2394
// Unexpected error
2395
2395
if err == nil || ! reflect .DeepEqual (expectedErr , err .Error ()) {
2396
2396
t .Errorf ("Test_parseParentAndPlugin_RecursivelyReference_withMultipleURI() unexpected error = %v" , err )
You can’t perform that action at this time.
0 commit comments