Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lazily initialize gate API client #10

Merged
merged 1 commit into from
May 18, 2021
Merged

Conversation

martinohmann
Copy link
Member

@martinohmann martinohmann commented May 17, 2021

The initialization of the gate API client results in an immediate API
call to the /version endpoint. This makes it impossible to use the
provider inside a module that will create the spinnaker as well
because the presence of the provider "spinnaker" {} block alone will
result in an API call to a non-existent endpoint.

This change delays the initialization of the gate API client until it is
needed. That allows the creation of the spinnaker and resources managed
by the spinnaker provider inside the same module by leveraging
depends_on.

The change also adds a Makefile to build and install the provider for
local testing as this has become a pain starting with terraform 0.13.

The initialization of the gate API client results in an immediate API
call to the `/version` endpoint. This makes it impossible to use the
provider inside of a module that will create the spinnaker as well
because the presence of the `provider "spinnaker" {}` block alone will
result in an API call to a non-existent endpoint.

This change delays the initialization of the gate API client until it is
needed. That allows the creation of the spinnaker and resources managed
by the spinnaker provider inside the same module by leveraging
`depends_on`.

The change also adds a `Makefile` to build and install the provider for
local testing as this has become a pain starting with terraform 0.13.
@martinohmann martinohmann merged commit 8aa7345 into master May 18, 2021
Copy link

@mmartins-bonial mmartins-bonial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@martinohmann martinohmann deleted the lazy-gate-client branch May 31, 2021 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants