-
Notifications
You must be signed in to change notification settings - Fork 38
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
Move parsing and name validation to cdi/parse package #130
Conversation
a709266
to
8ea61a7
Compare
35799bc
to
2fb1ea1
Compare
2fb1ea1
to
aa1fd48
Compare
pkg/cdi/qualified-device.go
Outdated
} | ||
|
||
// ParseQualifiedName splits a qualified name into device vendor, class, | ||
// and name. If the device fails to parse as a qualified name, or if any | ||
// of the split components fail to pass syntax validation, vendor and | ||
// class are returned as empty, together with the verbatim input as the | ||
// name and an error describing the reason for failure. | ||
// | ||
// Deprecated: use parser.Interface.ParseQualifiedName instead |
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.
Shouldn't this be use parser.ParseQualifiedName
without .Interface.
?
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.
pkg/cdi/qualified-device.go
Outdated
} | ||
|
||
// ParseDevice tries to split a device name into vendor, class, and name. | ||
// If this fails, for instance in the case of unqualified device names, | ||
// ParseDevice returns an empty vendor and class together with name set | ||
// to the verbatim input. | ||
// | ||
// Deprecated: use parser.Interface.ParseDevice instead |
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.
ditto here
pkg/cdi/qualified-device.go
Outdated
// If parsing fails, an empty vendor and the class set to the | ||
// verbatim input is returned. | ||
// | ||
// Deprecated: use parser.Interface.ParseQualifier instead |
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.
And here.
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.
I have 3 small nits related to doc strings. Otherwise LGTM.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Thanks. Missed updating the comments in my various iterations. |
aa1fd48
to
e53d516
Compare
@klihub thanks for the review. Updated. |
This should allow golang dependencies to be better managed.
See docker/cli#4084 (review)