Commit Graph

12119 Commits

Author SHA1 Message Date
Matt Keeler 6d94900cd7
Disable background cache refresh for Connect Leaf Certs
The rationale behind removing them is that all of our own code (xDS, builtin connect proxy) use the cache notification mechanism. This ensures that the blocking fetch behind the scenes is always executing. Therefore the only way you might go to get a certificate and have to wait is when 1) the request has never been made for that cert before or 2) you are using the v1/agent/connect/ca/leaf API for retrieving the cert yourself.

In the first case, the refresh change doesn’t alter the behavior. In the second case, it can be mitigated by using blocking queries with that API which just like normal cache notification mechanism will cause the blocking fetch to be initiated and to get leaf certs as soon as needed.

If you are not using blocking queries, or Envoy/xDS, or the builtin connect proxy but are retrieving the certs yourself then the HTTP endpoint might take a little longer to respond.

This also renames the RefreshTimeout field on the register options to QueryTimeout to more accurately reflect that it is used for any type that supports blocking queries.
2020-07-21 12:19:25 -04:00
Matt Keeler 133a6d99f2
Fix issue with changing the agent token causing failure to renew the auto-encrypt certificate
The fallback method would still work but it would get into a state where it would let the certificate expire for 10s before getting a new one. And the new one used the less secure RPC endpoint.

This is also a pretty large refactoring of the auto encrypt code. I was going to write some tests around the certificate monitoring but it was going to be impossible to get a TestAgent configured in such a way that I could write a test that ran in less than an hour or two to exercise the functionality.

Moving the certificate monitoring into its own package will allow for dependency injection and in particular mocking the cache types to control how it hands back certificates and how long those certificates should live. This will allow for exercising the main loop more than would be possible with it coupled so tightly with the Agent.
2020-07-21 12:19:25 -04:00
Ondrej Sika 5538d4ff7a
ui: Fix swapped node & service checks by fixing filter-by & reject-by (#8338) 2020-07-20 19:45:25 -04:00
Joel Watson 56c4d6e98f
docs: Add raft_multiplier default clarification (#8339) 2020-07-20 15:49:46 -06:00
Alvin Huang 5c3018da52
add v to version pretty formatter (#8341)
* add v to version pretty formatter

* remove v from json version output
2020-07-20 17:43:10 -04:00
Daniel Nephin 9f5f8abcbf
Merge pull request #8245 from hashicorp/dnephin/use-not-modified-in-cache
agent/cache: Use AllowNotModified in CatalogListServices
2020-07-20 15:30:52 -04:00
Daniel Nephin 235845af21
Merge pull request #8290 from hashicorp/dnephin/watch-decode
watch: fix script watches with single arg
2020-07-20 14:41:17 -04:00
Daniel Nephin b91f7ad7cf
Merge pull request #8328 from hashicorp/dnephin/go1.14.6
ci: Use go1.14.6
2020-07-20 13:32:54 -04:00
Kit Patella 3e5647c7e6
Merge pull request #8331 from hashicorp/cli/fix-cas-when-zero
command: fix cas put when index=0 and better errors in put and delete
2020-07-20 10:27:37 -07:00
John Cowen 59585f71a7
ui: Namespaces Redesign (#8336)
* ui: Add new consul-nspace-list component

* ui: Use new consul-nspace-list component

* Fix up other components to use linkable list-collection action

* ui: Remove some dead CSS
2020-07-20 18:12:34 +01:00
John Cowen ac629cd51e
ui: KV Form and List Components (#8307)
* Add components for KV form, KV list and Session form

* Pass through a @label attribute for a human label + don't require error

* Ignore transition aborted errors for if you are re-transitioning

* Make old confirmation dialog more ember-like and tagless

* Make sure data-source and data-sink supports KV and sessions

* Use new components and delete all the things

* Fix up tests

* Make list component tagless

* Add component pageobject and fixup tests from that

* Add eslint warning back in
2020-07-20 18:04:43 +01:00
John Cowen bc20da8fd7
ui: Add some missed spaces in component README files (#8335) 2020-07-20 17:43:10 +01:00
Kit Patella b47fcf7282 command/kv: remove error case in put and edit error message for delete 2020-07-20 09:15:25 -07:00
Kit Patella 369a92c71f command: fix cas put when index=0 and better errors in put and delete 2020-07-17 13:03:36 -07:00
Daniel Nephin cf89cb20db
Merge pull request #8269 from hashicorp/dnephin/ci-add-go-test-race
ci: add 'go test -race'
2020-07-17 14:35:32 -04:00
Daniel Nephin 08741c85b0 ci: add 'go test -race' job
Running every test with the race detector would add significant time to
CI. That additionaltime won't provide much value as many of the integration tests use
much of the same code.

For now we can run -race on some of the smaller packages. As we move
more code into smaller packages we should be able to add more packages
to the list that runs with '-race'.

For now this is running without parallelism, but we can enable that as
well when we need it.

boltdb fails the 'checkptr' check, which is automatically enabled by
'-race', so I've disabled checkptr as well.
2020-07-17 13:32:16 -04:00
Alvin Huang 2d1ab42c17
ci: separate install-gotestsum step into its own config (#8327) 2020-07-17 13:00:31 -04:00
Daniel Nephin 76336301ca ci: Use go1.14.6
Includes the security patches from go14.5 and https://github.com/golang/go/issues/39308
to fix our test logs.
2020-07-17 12:02:16 -04:00
Blake Covarrubias 4fecce1344 docs: Fix heading for list prepared queries endpoint 2020-07-17 09:00:17 -07:00
John Cowen 8cb402eae7
ui: Move routes to use data-sources (#8321)
* Add uri identifiers to all data source things and make them the same

1. Add uri identitifer to data-source service
2. Make <EventSource /> and <DataSource /> as close as possible
3. Add extra `.closed` method to get a list of inactive/closed/closing
data-sources from elsewhere

* Make the connections cleanup the least worst connection when required

* Pass the uri/request id through all the things

* Better user erroring

* Make event sources close on error

* Allow <DataLoader /> data slot to be configurable

* Allow the <DataWriter /> removed state to be configurable

* Don't error if meta is undefined

* Stitch together all the repositories into the data-source/sink

* Use data.source over repositories

* Add missing  <EventSource /> components

* Fix up the views/templates

* Disable all the old route based blocking query things

* We still need the repo for the mixin for the moment

* Don't default to default, default != ''
2020-07-17 14:42:45 +01:00
John Cowen 0b6a098aca
ui: Fix sticky action popover menus (#8326)
* ui Close more-popover-menus in KV and nspaces on confirmation

* ui: Close more-popovermenus on confirmation on composite-rows
2020-07-17 14:28:32 +01:00
John Cowen 287e4f591f
ui: Change some components to use willDestroyElement vs willDestroy (#8313)
* ui: Change <DataSource /> to use willDestroyElement vs willDestroy

* Change 3 more components to use willDestroyElement vs willDestroy
2020-07-17 09:49:58 +01:00
Blake Covarrubias d17cc4044d
docs: Fix link to kv_max_value_size config option (#8322)
The sizing recommendation link should point to the config option for
tuning kv_max_value_size.
2020-07-16 14:13:06 -07:00
Sabeen Syed 5898692543
Merge pull request #8259 from hashicorp/enterprise_docs_update
Consul Enterprise docs update
2020-07-16 15:34:15 -05:00
Daniel Nephin 374ac7178f
Merge pull request #8282 from hashicorp/dnephin/unmethod-store-funcs-oss
state: convert methods that don't use their receiver to functions
2020-07-16 16:04:19 -04:00
Daniel Nephin 75f10fb191 state: update calls that are no longer state methods
In a previous commit these methods were changed to functions, so remove the Store paramter.
2020-07-16 15:46:10 -04:00
Daniel Nephin 3fcb2e16f4 state: un-method funcs that don't use their receiver
This change was mostly automated with the following

First generate a list of functions with:

  git grep -o 'Store) \([^(]\+\)(tx \*txn' ./agent/consul/state | awk '{print $2}' | grep -o '^[^(]\+'

Then the list was curated a bit with trial/error to remove and add funcs
as necessary.

Finally the replacement was done with:

  dir=agent/consul/state
  file=${1-funcnames}

  while read fn; do
    echo "$fn"
    sed -i -e "s/(s \*Store) $fn(/$fn(/" $dir/*.go
    sed -i -e "s/s\.$fn(/$fn(/" $dir/*.go
    sed -i -e "s/s\.store\.$fn(/$fn(/" $dir/*.go
  done < $file
2020-07-16 15:30:39 -04:00
Daniel Nephin edb0a4f1f8 store: convert methods that don't use their receiver to functions
Making these functions allows them to be used without introducing
an artificial dependency on the struct. Many of these will be called
from streaming Event processors, which do not have a store.

This change is being made ahead of the streaming work to get to reduce
the size of the streaming diff.
2020-07-16 15:30:10 -04:00
John Cowen f26124d42c
ui: Better error message checking for cross dc connect check (#8320) 2020-07-16 18:27:34 +01:00
André e93084be6c
minor: fix docstring of DNSOnlyPassing (#8318)
In runtime.go it had "duration" but it is actually a boolean.
2020-07-16 09:47:33 -04:00
Rebecca Zanzig c34434d2fa
Merge pull request #8140 from hashicorp/k8s/gateway-setup-docs
K8s ingress and terminating gateway setup docs
2020-07-15 16:44:36 -07:00
Kyle Schochenmaier 01fdd638e3
Apply suggestions from code review 2020-07-15 18:24:55 -05:00
Kyle Schochenmaier 8804f7b322
Merge branch 'master' into k8s/gateway-setup-docs 2020-07-15 17:47:21 -05:00
Kyle Schochenmaier 08db6cfd20
ingress gw docs for k8s (#8291)
Co-authored-by: Derek Strickland 
Co-authored-by: Luke Kysow <1034429+lkysow@users.noreply.github.com>
2020-07-15 17:45:20 -05:00
Jeff Escalante 3d91a21d44
Merge pull request #8230 from hashicorp/je.pin-deps
📌 Hard Pin Website Dependencies
2020-07-15 18:45:19 -04:00
Jeff Escalante 6c2a9bf913
Merge pull request #8277 from hashicorp/je.website-maintenance-7-8-20
Update dependencies, format all files
2020-07-15 18:44:53 -04:00
Kyle Schochenmaier b7c970adb0 update sidebar 2020-07-15 17:42:48 -05:00
Kyle Schochenmaier a384226876 remove term-gw until its ready to merge and update redirects 2020-07-15 17:38:23 -05:00
Alvin Huang 03164822ee
add back missing quote in bashenv for CI (#8317) 2020-07-15 17:21:40 -04:00
Alvin Huang 1c44b4b774
[skip ci] bump master to 1.9.0 to track next release version (#8315) 2020-07-15 14:48:36 -04:00
Daniel Nephin 5eba846c63
Merge pull request #8160 from hashicorp/streaming/add-event-publisher
streaming: add EventPublisher and stream package
2020-07-15 12:46:26 -04:00
Daniel Nephin 797abe1f00 agent/cache: Use AllowNotModifiedResponse in CatalogListServices
Co-authored-by: Pierre Souchay <pierresouchay@users.noreply.github.com>
2020-07-14 18:58:20 -04:00
Daniel Nephin 8aa3335b22 agent/cache: Update some docstrings 2020-07-14 18:58:20 -04:00
Daniel Nephin a2f8605c66 stream: Add forceClose and refactor subscription filtering
Move the subscription context to Next. context.Context should generally
never be stored in a struct because it makes that struct only valid
while the context is valid. This is rarely obvious from the caller.
Adds a forceClosed channel in place of the old context, and uses the new
context as a way for the caller to stop the Subscription blocking.

Remove some recursion out of bufferImte.Next. The caller is already looping so we can continue
in that loop instead of recursing. This ensures currentItem is updated immediately (which probably
does not matter in practice), and also removes the chance that we overflow the stack.

NextNoBlock and FollowAfter do not need to handle bufferItem.Err, the caller already
handles it.

Moves filter to a method to simplify Next, and more explicitly separate filtering from looping.

Also improve some godoc

Only unwrap itemBuffer.Err when necessary
2020-07-14 15:57:47 -04:00
Daniel Nephin 2595436f62 stream: Improve docstrings
Also rename ResumeStrema to EndOfEmptySnapshot to be more consistent with other framing events

Co-authored-by: Paul Banks <banks@banksco.de>
2020-07-14 15:57:47 -04:00
Daniel Nephin 16a2b3fafc stream: change Topic to an interface
Consumers of the package can decide on which type to use for the Topic. In the future we may
use a gRPC type for the topic.
2020-07-14 15:57:47 -04:00
Daniel Nephin aa571bd0ce state: Move change processing out of EventPublisher
EventPublisher was receiving TopicHandlers, which had a couple of
problems:

- ChangeProcessors were being grouped by Topic, but they completely
  ignored the topic and were performed on every change
- ChangeProcessors required EventPublisher to be aware of database
  changes

By moving ChangeProcesors out of EventPublisher, and having Publish
accept events instead of changes, EventPublisher no longer needs to
be aware of these things.

Handlers is now only SnapshotHandlers, which are still mapped by Topic.

Also allows us to remove the small 'db' package that had only two types.
They can now be unexported types in state.
2020-07-14 15:57:47 -04:00
Daniel Nephin 23a940daad server: Abandom state store to shutdown EventPublisher
So that we don't leak goroutines
2020-07-14 15:57:47 -04:00
Daniel Nephin e1305fe80c stream: unexport identifiers
Now that EventPublisher is part of stream a lot of the internals can be hidden
2020-07-14 15:57:47 -04:00
Daniel Nephin 9e37894778 stream: Move EventPublisher to stream package
The EventPublisher is the central hub of the PubSub system. It is toughly coupled with much of
stream. Some stream internals were exported exclusively for EventPublisher.

The two Subscribe cases (with or without index) were also awkwardly split between two packages. By
moving EventPublisher into stream they are now both in the same package (although still in different files).
2020-07-14 15:57:47 -04:00