-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
Signed-off-by: Hasan Turken <turkenh@gmail.com>
Signed-off-by: Hasan Turken <turkenh@gmail.com>
Signed-off-by: Hasan Turken <turkenh@gmail.com>
Signed-off-by: Hasan Turken <turkenh@gmail.com>
Signed-off-by: Hasan Turken <turkenh@gmail.com>
config/overrides.go
Outdated
|
||
func externalNameOverride() tjconfig.ResourceOption { | ||
return func(resource *tjconfig.Resource) { | ||
resource.ExternalName.GetExternalNameFn = common.GetNameFromFullyQualifiedID |
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.
GetExternalNameFn
should be compatible with GetIDFn
. Right now, it would return the last part of the ID as external name and then when it constructs the ID, it will copy that external name. My suggestion would be to use a provider-wide default for the whole resource.ExternalName
configuration, instead of only resource.ExternalName.GetExternalNameFn
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'll work on a provider-wide default for external name in a follow-up PR.
Reverted defaulting for now and moved to individual resource configs.
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 meant something like common.IdentifierFromProvider
that has all sub-configs compatible for each other.
Signed-off-by: Hasan Turken <turkenh@gmail.com>
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.
Thanks @turkenh !
Description of your changes
This PR configures external-name properly with latest Terrajet config options.
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
Deploy example compute instance.