397 add annotation to imported elements#80
Conversation
Signed-off-by: Stephanie <[email protected]>
…ationToImportedElements
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
| // AddSourceAttributesForParentOverride adds an attribute 'library.devfile.io/imported-from=<source reference>' | ||
| // to all elements of parent override that support attributes. | ||
| func AddSourceAttributesForParentOverride(sourceImportReference v1.ImportReference, parentoverride *v1.ParentOverrides) { | ||
| for idx, component := range parentoverride.Components { |
There was a problem hiding this comment.
should check if parentoverride is nil before using it, same for the others. Can we camel case to parentOverride?
There was a problem hiding this comment.
updated. check the nil pointer in the top level function AddSourceAttributesForOverrideAndMerge as you suggested
Signed-off-by: Stephanie <[email protected]>
| } | ||
|
|
||
| // AddSourceAttributesForPluginOverride adds an attribute 'library.devfile.io/imported-from=<source reference>' | ||
| // addSourceAttributesForPluginOverride adds an attribute 'library.devfile.io/imported-from=<source reference>' |
There was a problem hiding this comment.
need to update func desc for the updated attribute key, same for the parent override func
|
@yangcao77 Can you also check this screenshot? #80 (review) |
|
@maysunfaisal #80 (review) has been fixed. the error is checked and returned outside of the switch case |
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
41b592c to
e3d1c45
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maysunfaisal, yangcao77 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |

What does this PR do?
This PR adds an attribute to all elements from the imported source before override & merge. This attribute information can be used by validator to track from which devfile the error came from.
What issues does this PR fix or reference?
devfile/api#397
Is your PR tested? Consider putting some instruction how to test your changes
Update unit tests. Add more unit tests to test the import attribute fields