-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
397 add annotation to imported elements #80
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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to update func desc for the updated attribute key, same for the parent override func
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
@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
Needs 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