Skip to content

Commit 32d5250

Browse files
committed
Clarify the documentation of ParserArgs.Path
Signed-off-by: Armel Soro <asoro@redhat.com>
1 parent 02f8362 commit 32d5250

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pkg/devfile/parser/context/context.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ type DevfileCtx struct {
3232
// absolute path of devfile
3333
absPath string
3434

35-
// relative path of devfile
35+
// relative path of devfile.
36+
// It can also be a relative or absolute path to a folder containing one or more devfiles,
37+
// in which case the library will try to pick an existing one, based on the following priority order:
38+
// devfile.yaml > .devfile.yaml > devfile.yml > .devfile.yml
3639
relPath string
3740

3841
// raw content of the devfile

pkg/devfile/parser/parse.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ func parseDevfile(d DevfileObj, resolveCtx *resolutionContextTree, tool resolver
8080
// ParserArgs is the struct to pass into parser functions which contains required info for parsing devfile.
8181
// It accepts devfile path, devfile URL or devfile content in []byte format.
8282
type ParserArgs struct {
83-
// Path is a relative or absolute devfile path on disk
83+
// Path is a relative or absolute devfile path on disk.
84+
// It can also be a relative or absolute path to a folder containing one or more devfiles,
85+
// in which case the library will try to pick an existing one, based on the following priority order:
86+
// devfile.yaml > .devfile.yaml > devfile.yml > .devfile.yml
8487
Path string
8588
// URL is the URL address of the specific devfile.
8689
URL string

0 commit comments

Comments
 (0)