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

Adds consul_prepared_query resource #7474

Merged
merged 18 commits into from
Aug 18, 2016
Merged

Adds consul_prepared_query resource #7474

merged 18 commits into from
Aug 18, 2016

Conversation

ryanuber
Copy link
Member

@ryanuber ryanuber commented Jul 2, 2016

Requires hashicorp/consul#2160.

/cc @slackpad for prepared query stuff

@ryanuber ryanuber force-pushed the f-consul-pq branch 2 times, most recently from d402bbc to 2841ded Compare July 2, 2016 23:32
@jen20
Copy link
Contributor

jen20 commented Jul 3, 2016

Hey @ryanuber! First look here is good, but there are a few build errors of the form:

builtin/providers/consul/resource_consul_prepared_query.go:179: pq.Service.Near undefined (type api.ServiceQuery has no field or method Near)
builtin/providers/consul/resource_consul_prepared_query.go:194: pq.Template undefined (type *api.PreparedQueryDefinition has no field or method Template)
builtin/providers/consul/resource_consul_prepared_query.go:195: pq.Template undefined (type *api.PreparedQueryDefinition has no field or method Template)
builtin/providers/consul/resource_consul_prepared_query.go:196: pq.Template undefined (type *api.PreparedQueryDefinition has no field or method Template)
builtin/providers/consul/resource_consul_prepared_query.go:225: unknown api.ServiceQuery field 'Near' in struct literal
builtin/providers/consul/resource_consul_prepared_query.go:251: undefined: api.QueryTemplate

Do we need to also upgrade the vendored version of the Consul API?

@ryanuber
Copy link
Member Author

ryanuber commented Jul 3, 2016

@jen20 yep! I was waiting for hashicorp/consul#2160 to get merged first. Vendor is updated and builds should pass now. I also fixed a few edge cases in my last couple of commits.

ttl = "5m"
}

template {
Copy link

@slackpad slackpad Jul 4, 2016

Choose a reason for hiding this comment

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

Since the service argument uses this regex, I'd put the template definition higher up.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good call. Probably easier to follow that way.

@slackpad
Copy link

slackpad commented Jul 4, 2016

@ryanuber super excited to see this!

@stack72
Copy link
Contributor

stack72 commented Aug 18, 2016

This LGTM! Had to rebase it to remove the merge conflicts :)

% make testacc TEST=./builtin/providers/consul TESTARGS='-run=TestAccConsul'                        ✹
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/08/18 08:39:45 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/consul -v -run=TestAccConsul -timeout 120m
=== RUN   TestAccConsulAgentService_basic
--- PASS: TestAccConsulAgentService_basic (0.02s)
=== RUN   TestAccConsulCatalogEntry_basic
--- PASS: TestAccConsulCatalogEntry_basic (0.03s)
=== RUN   TestAccConsulKeyPrefix_basic
--- PASS: TestAccConsulKeyPrefix_basic (0.07s)
=== RUN   TestAccConsulKeys_basic
--- PASS: TestAccConsulKeys_basic (0.05s)
=== RUN   TestAccConsulNode_basic
--- PASS: TestAccConsulNode_basic (0.02s)
=== RUN   TestAccConsulPreparedQuery_basic
--- PASS: TestAccConsulPreparedQuery_basic (0.06s)
=== RUN   TestAccConsulService_basic
--- PASS: TestAccConsulService_basic (0.02s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/consul 0.278s

@stack72 stack72 merged commit ec7fc60 into master Aug 18, 2016
@stack72 stack72 deleted the f-consul-pq branch August 18, 2016 07:46
kwilczynski pushed a commit to kwilczynski/terraform that referenced this pull request Aug 18, 2016
* provider/consul: first stab at adding prepared query support

* provider/consul: flatten pq resource

* provider/consul: implement updates for PQ's

* provider/consul: implement PQ delete

* provider/consul: add acceptance tests for prepared queries

* provider/consul: add template support to PQ's

* provider/consul: use substructures to express optional related components for PQs

* website: first pass at consul prepared query docs

* provider/consul: PQ's support datacenter option and store_token option

* provider/consul: remove store_token on PQ's for now

* provider/consul: allow specifying a separate stored_token

* website: update consul PQ docs

* website: add link to consul_prepared_query resource

* vendor: update github.com/hashicorp/consul/api

* provider/consul: handle 404's when reading prepared queries

* provider/consul: prepared query failover dcs is a list

* website: update consul PQ example usage

* website: re-order arguments for consul prepared queries
@ghost
Copy link

ghost commented Apr 23, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants