Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

add version into definitionReference for workload/trait/scope definitions #268

Merged
merged 2 commits into from
Oct 26, 2020

Conversation

wonderflow
Copy link
Member

fix #210

Signed-off-by: 天元 [email protected]

PartialResource: gvr,
}
}
return kinds[0], nil
Copy link
Collaborator

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?

Copy link
Member Author

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.

@@ -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) {
Copy link
Member

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.

Copy link
Member

@hongchaodeng hongchaodeng Oct 26, 2020

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.

Copy link
Member Author

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.

Copy link
Member

@hongchaodeng hongchaodeng left a 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

@wonderflow wonderflow merged commit 696eb7b into crossplane:master Oct 26, 2020
@wonderflow wonderflow deleted the refdef branch October 26, 2020 05:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] add apiversion and kind into Definition
3 participants