Skip to content

improve validation error messages on imported elements #397

Closed
devfile/library
#85
@yangcao77

Description

@yangcao77

Since the library do validation on flattened devfile, the current error message only contains the element name, does not contain the original source. It is unclear and hard to trace, library should do similar as DWO is doing: https://github.com/devfile/devworkspace-operator/blob/81b939ec513099fbb7f94959bdd5c6f37c47c62d/pkg/library/annotate/plugins.go#L22

An attribute can be added to the element before merge, validator (in devfile/api repo) can include this information in the error message

library.devfile.io/imported-by=<source-location>

This issue also expect change on devfile/api repo, as the validation is actually done in devfile/api validator.
validator will check for the specific attribute before sending back the error message. If the attribute does not exist, the error message will be as what it currently has.

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