Skip to content

make the parse function more generic #369

@yangcao77

Description

@yangcao77

devfile/libray currently has 4 parse functions ParseFromPath, ParseFromURL, ParseFromData, ParseRawDevfile
The logic of those 4 parse functions are similar, the only difference is that they take different parameter types.

The issue is to deprecate the existing parse functions, and create a new ParseDevfile, which combines the logic of those 4 functions. It should take an argument as following:

type ParserArgs struct {
	path             string
	url              string
	data             []byte
	flattenedDevfile *bool	// default to true
	registryURLs     []string
}

Populate() and PopulateFromURL() and PopulateFromRaw() should also be combined.

Metadata

Metadata

Assignees

Labels

area/libraryCommon devfile library for interacting with devfileskind/enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions