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

tinkerbell: defer client creation to first resource operation #11

Merged
merged 1 commit into from
Oct 8, 2020

Conversation

invidian
Copy link
Contributor

@invidian invidian commented Oct 8, 2020

As Terraform was not originally designed to Terraform code feed and
configure another provider, if one uses interpolation in provider
configuration, which is a legitimate use (e.g. when you create server
and deploy Tinkerbell using the same Terraform stack which later on adds
hardware entries), client creation will fail, as it is not guaranteed
that the fields will be populated on time.

This commit defers Tinkerbell client creation to the point where first
resource is actually created, which can be ensured with Terraform
depends_on option on the resources level.

Signed-off-by: Mateusz Gozdek [email protected]

As Terraform was not originally designed to Terraform code feed and
configure another provider, if one uses interpolation in provider
configuration, which is a legitimate use (e.g. when you create server
and deploy Tinkerbell using the same Terraform stack which later on adds
hardware entries), client creation will fail, as it is not guaranteed
that the fields will be populated on time.

This commit defers Tinkerbell client creation to the point where first
resource is actually created, which can be ensured with Terraform
depends_on option on the resources level.

Signed-off-by: Mateusz Gozdek <[email protected]>
@invidian invidian merged commit 745a2da into master Oct 8, 2020
@invidian invidian deleted the invidian/defer-client-creation branch October 8, 2020 09:30
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.

1 participant