-
Notifications
You must be signed in to change notification settings - Fork 135
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
Moving client creation to resource to allow for provider interpolation #119
Moving client creation to resource to allow for provider interpolation #119
Conversation
Thanks for doing this! I'm curious why this isn't building on travis. |
I was curious about that too. I wasn't sure if there was something manual. Let me take a peak. |
.... I'm assuming you just did something xD |
Looks like Travis has disabled OSS builds. If you can trigger a rebuild when you have a second. This should be close.. |
d5e0b35
to
19587f6
Compare
@phillbaker Happy to donate some money for additional credits. Right now the lowest price point for me to give credits is $70, and I'm more in the $10 - $20 contribution range :) Would love to see this get merged and consume it. |
I'm in the process of moving this repo to github actions. For the time being, if you'd like to run the tests locally, that'd be the quickest way to iterate on this PR. |
Will do. |
Tests are passing locally. Let me know if I can do anything further.
|
Saw another that in PR 120, the contributor setup travis in his own account. So I followed suit |
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 for the work on this, much appreciated!
if err != nil { | ||
return err | ||
} | ||
if client, ok := esClient.(*elastic7.Client); ok { |
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 should come back and use a switch/case here
@@ -8,6 +8,7 @@ import ( | |||
|
|||
"github.com/hashicorp/terraform-plugin-sdk/helper/schema" | |||
"github.com/hashicorp/terraform-plugin-sdk/helper/structure" | |||
|
|||
// "github.com/hashicorp/terraform-plugin-sdk/helper/validation" |
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.
Whoops, I should clean this up
return elastic7PutRoleMapping(client, name, body) | ||
} | ||
if client, ok := m.(*elastic6.Client); ok { | ||
if client, ok := esClient.(*elastic6.Client); ok { |
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.
Same here, I should come back and use a switch/case in this file
if err != nil { | ||
return err | ||
} | ||
if client, ok := esClient.(*elastic7.Client); ok { |
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.
More eventual clean up for switch/case
* origin/master: Moving client creation to resource to allow for provider interpolation (phillbaker#119)
Thanks for accepting this. Any idea on timeline for cutting another revision? |
@john-delivuk-rl sorry for the slow response, it's released in https://registry.terraform.io/providers/phillbaker/elasticsearch/1.5.1-beta1, should be a full 1.5.1 in the next couple of days. |
While looking through I noticed several issues around being able to interpolate the provider. While this was an issue in previous version of terraform, it's been resolved. You can see in providers like MySQL, the
providerConfigure
only returns a configuration struct. I've implemented the same pattern to allow for proper resource dependencies. I think a few tests might still have an issue, but I'll work to remediate these today.I think long term this code would benefit an interface around elastic search and a class factory to simply that logic, I tried to leave as much of the existing code alone as possible, as this is a large change already.
UPDATE: Running this locally and everything is running great. It's so nice to not use work arounds :)