upjet icon indicating copy to clipboard operation
upjet copied to clipboard

`SetIdentifierArgumentsFn` use external name as input instead of name

Open dougsong opened this issue 2 years ago • 1 comments

What happened?

The following picture in add-new-resource-long shows SetIdentifierArgumentFn use metadata.name as input, but as source code shown, actual use external name, is this picture drawn wrong, or do I understand it wrong?

https://github.com/upbound/upjet/blob/f79f70f4904587ff29688f20f7380afbc33e842b/pkg/terraform/files.go#L66 https://github.com/upbound/upjet/blob/f79f70f4904587ff29688f20f7380afbc33e842b/pkg/config/resource.go#L28

dougsong avatar May 31 '23 09:05 dougsong

Hi @dougsong, Per the Crossplane resource model, the source of truth for the external resource's name is the external-name annotation: https://github.com/crossplane/crossplane/blob/master/design/one-pager-managed-resource-api-design.md#external-resource-name

We may fix the diagram if it's confusing. The SetIdentifierArgumentsFn arrow should originate from the external-name annotation.

ulucinar avatar Oct 10 '23 13:10 ulucinar