-
Notifications
You must be signed in to change notification settings - Fork 80
add version into definitionReference for workload/trait/scope definitions #268
Conversation
PartialResource: gvr, | ||
} | ||
} | ||
return kinds[0], nil |
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 am not sure that this is a good assumption. How can there be multiple kinds when the version is set?
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.
This is used for cases whose version was not set.
…ions Signed-off-by: 天元 <[email protected]>
@@ -297,6 +299,23 @@ func GetDefinitionName(dm discoverymapper.DiscoveryMapper, u *unstructured.Unstr | |||
return mapping.Resource.Resource + "." + groupVersion.Group, nil | |||
} | |||
|
|||
// GetGVKFromDefinition help get Group Version Kind from DefinitionReference | |||
func GetGVKFromDefinition(dm discoverymapper.DiscoveryMapper, definitionRef v1alpha2.DefinitionReference) (schema.GroupVersionKind, error) { |
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 don't see any place that uses this method.
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.
Could you provide an example how this is gonna be used?
I mean real use cases, not tests.
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.
sorry, I added one in the code.
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.
code lgtm
Please provide use cases for GVKFromDefinition method
fix #210
Signed-off-by: 天元 [email protected]