Add marketplace annotation to generated example manifests#75
Add marketplace annotation to generated example manifests#75ezgidemirel merged 3 commits intocrossplane:mainfrom ezgidemirel:example-group-annotation
Conversation
…anifests Signed-off-by: ezgidemirel <ezgidemirel91@gmail.com>
pkg/examples/example.go
Outdated
| defaultExampleName = "example" | ||
| defaultNamespace = "upbound-system" | ||
| labelExampleName = "testing.upbound.io/example-name" | ||
| annotationExampleGroup = "meta.upbound.io/example-group" |
There was a problem hiding this comment.
| annotationExampleGroup = "meta.upbound.io/example-group" | |
| annotationExampleGroup = "meta.upbound.io/example-gvk" |
As the value format for this key, my suggestion would be:
<group>/<version>.<kind>
, or
<group>/<version>/<kind>
There was a problem hiding this comment.
I updated the PR as <shortgroup>/<version>/<kind>
There was a problem hiding this comment.
I don't have a strong opinion, but using the CRD name could be easier for figuring out the association on the marketplace side, i.e. <plural kind>.<group> like instances.ec2.aws.upbound.io. Version is probably irrelevant since we don't publish examples for each version.
Or maybe we can just re-use the label we use for label selectors. @hasheddan what's the best way for you folks to set up the association?
There was a problem hiding this comment.
Hey folks! So I would suggest going with meta.upbound.io/example-id and then using whatever grouping value you like. The way the Marketplace is planning to handle this is to take all resources with the same meta.upbound.io/example-id, combine them into a single document to be stored, and then show them on the examples page for every resource type in the group. So, for example, if you put meta.upbound.io/example-id: super-cool-example on a VPC and 3 Subnets, those four types together would be shown as a single example on both the VPC and Subnet examples page.
Let me know if there is additional functionality that y'all feel like this does not accommodate!
There was a problem hiding this comment.
Hi @hasheddan,
One concern that we currently have with this scheme (where we use the the short group name instead of a fully qualified group name, e.g., iam instead of iam.aws.upbound.io) is that if multiple providers possess groups with the same short name, would we still be able to correctly group example manifests for shared kind names?
Short group names are unique among a provider and is this enough to correctly group dependencies while showing examples? We would like to prevent a situation where an iam.Role dependency in GCP from appearing as a dependency to an AWS resource. Is the grouping done in the context of a single provider or across all providers available in the market place?
There was a problem hiding this comment.
Is the grouping done in the context of a single provider or across all providers available in the market place?
@ulucinar the grouping is done in the context of a single provider package version -- so, for example, upbound/provider-aws:v0.9.0 is it's own "examples namespace" :)
Signed-off-by: ezgidemirel <ezgidemirel91@gmail.com>
…ation Signed-off-by: ezgidemirel <ezgidemirel91@gmail.com>
ulucinar
left a comment
There was a problem hiding this comment.
Thanks @ezgidemirel, lgtm.
Signed-off-by: ezgidemirel ezgidemirel91@gmail.com
Description of your changes
This PR adds
meta.upbound.io/example-groupannotation to generated example manifests in the same file with the value of the target resource's "shortgroup/version/kind". Using this annotation, we can display these manifests together in the marketplace.Fixes #65
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Consumed it in provider-aws and generated example manifests. An example file is below: