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

Add certificate_name to load balancer data source. #641

Merged
merged 5 commits into from May 28, 2021

Conversation

andrewsomething
Copy link
Member

@andrewsomething andrewsomething commented May 27, 2021

The load balancer data source and resource share a common flattenForwardingRules method:

func flattenForwardingRules(client *godo.Client, rules []godo.ForwardingRule) ([]map[string]interface{}, error) {

When using the load balancer data source with a load balancer that has a TLS certificate, we're seeing errors setting the data to state. This is because the shared method adds certificate_name to the forwarding rule, but currently only the resource uses that. This PR adds the attribute to the data source as well.

Fixes: #569

$ make testacc TESTARGS='-run=TestAccDataSourceDigitalOceanLoadBalancer_tlsCert'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccDataSourceDigitalOceanLoadBalancer_tlsCert -timeout 120m
?       github.com/digitalocean/terraform-provider-digitalocean [no test files]
=== RUN   TestAccDataSourceDigitalOceanLoadBalancer_tlsCert
=== PAUSE TestAccDataSourceDigitalOceanLoadBalancer_tlsCert
=== CONT  TestAccDataSourceDigitalOceanLoadBalancer_tlsCert
--- PASS: TestAccDataSourceDigitalOceanLoadBalancer_tlsCert (130.70s)
PASS
ok      github.com/digitalocean/terraform-provider-digitalocean/digitalocean    130.714s
testing: warning: no tests to run
PASS
ok      github.com/digitalocean/terraform-provider-digitalocean/internal/datalist       (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/digitalocean/terraform-provider-digitalocean/internal/mutexkv        (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/digitalocean/terraform-provider-digitalocean/internal/setutil        (cached) [no tests to run]

@andrewsomething andrewsomething requested a review from a team May 27, 2021 14:44
Copy link
Member

@bentranter bentranter left a comment

Choose a reason for hiding this comment

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

LGTM!

@andrewsomething andrewsomething merged commit d1f4688 into main May 28, 2021
@andrewsomething andrewsomething deleted the asb/issues/569 branch August 12, 2022 15:23
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.

failure to plan request due to random errors from loadbalancer
2 participants