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

Release/1.9.x logo asset update #10083

Closed
wants to merge 83 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
a482af6
Add operations section to k8s notes (#9625)
lkysow Jan 29, 2021
d2be858
Add docs for TLS Server Certificate rotation for K8S (#9636)
Jan 29, 2021
7de112b
website: add release notes for 1.9 (#9189)
mikemorris Jan 29, 2021
e871ad8
Putting source back into Dev Mode
hashicorp-ci Feb 1, 2021
f1e3f87
Merge pull request #9677 from hashicorp/km.hcp
BrandonRomano Feb 2, 2021
e20c396
docs/nia: Update verbiage around securely configuring providers (#9684)
findkim Feb 2, 2021
aac3aac
docs/nia: recommend sensitive variables for module authoring (#9692)
findkim Feb 2, 2021
ce79195
docs: Small change to fix broken link to k8s upgrade from k8s tls cer…
Feb 4, 2021
c840ad9
docs: fix another broken link to upgrading k8s servers from token rot…
Feb 4, 2021
382b350
xds: deduplicate mesh gateway listeners in a stable way (#9650)
rboyer Feb 5, 2021
7ca3bda
xds: prevent LDS flaps in mesh gateways due to unstable datacenter li…
rboyer Feb 8, 2021
8014954
Crosslink new microservices collection. (#9704)
DerekStrickland Feb 8, 2021
a5c1cd2
Avoid potential proxycfg/xDS deadlock using non-blocking send
freddygv Feb 8, 2021
b0dfc7a
Stop background refresh of cached data for requests that result in AC…
mkeeler Feb 9, 2021
7beeb12
website: update next and nextjs-scripts (#9698)
Feb 9, 2021
b64a93c
connect: connect CA Roots in the primary datacenter should use a Sign…
rboyer Feb 9, 2021
2ee5cf0
Merge pull request #9745 from hashicorp/dnephin/fix-streaming-bugs
dnephin Feb 9, 2021
3e7bb52
connect: update supported envoy point releases to 1.16.2, 1.15.3, 1.1…
rboyer Feb 10, 2021
d802625
Log replication warnings when no error suppression is defined (#9320)
crhino Jan 8, 2021
fe65a42
ui: [BUGFIX] Replace all replaceAll with split.join for older browser…
johncowen Feb 11, 2021
f58d97b
ui: [BUGFIX] Ensure we show the correct count of instances for each n…
johncowen Feb 11, 2021
c752098
Add docs section on regenerating expired CA certificates (#9709)
preetapan Feb 11, 2021
a9624db
Merge pull request #9758 from hashicorp/dnephin/fix-streaming-bugs
dnephin Feb 12, 2021
d2758e6
Merge pull request #9762 from hashicorp/er/nagios-sensu-update
eddie-rowe Feb 12, 2021
e8cdc33
Merge pull request #9772 from hashicorp/streamin-fix-bad-cached-snapshot
dnephin Feb 16, 2021
50ea949
Add docs for MIME sniffing on metrics endpoint. (#9696)
banks Feb 17, 2021
49b2721
Bump components to remove client-side md processing (#9773)
zchsh Feb 17, 2021
314d5a6
Docs describing migrating to CRDs (#9562)
lkysow Feb 17, 2021
f476f29
Update helm docs for consul-helm v0.30.0 (#9779)
Feb 17, 2021
da79ed2
Remove jfrog references (#9782)
mdeggies Feb 17, 2021
c6d284e
remove reference to docker/ path for old docker mirror (#9783)
alvin-huang Feb 17, 2021
b59687f
rotate homepage tutorials (#9787)
kaitlincart Feb 18, 2021
6f72841
Merge pull request #9777 from hashicorp/dnephin/remove-some-deprecation
dnephin Feb 19, 2021
44534bc
xds: only try to create an ipv6 expose checks listener if ipv6 is sup…
rboyer Feb 19, 2021
002d06f
Merge pull request #9763 from hashicorp/dnephin/cache-warn-on-error-i…
dnephin Feb 19, 2021
e06c2a0
[Website] Use new logo for Mercedes use case (#9717)
EnMod Feb 22, 2021
71f6747
fix typo and add link to Learn (#9799)
kaitlincart Feb 22, 2021
82953d6
connect: if the token given to the vault provider returns no data avo…
rboyer Feb 22, 2021
b26ff29
docs: Fix code tag displaying on ACL binding rules
blake Feb 22, 2021
9ef924d
test: omit envoy golden test files that differ from the latest versio…
rboyer Feb 24, 2021
b312ad0
ui: Remove any trailing fullstop/period DNS characters from Gateways …
johncowen Feb 25, 2021
c761a18
nia/docs 0.1.0 beta (#9803) (#9834)
findkim Feb 25, 2021
34a9da5
Merge pull request #9188 from hashicorp/dnephin/more-streaming-tests
dnephin Feb 26, 2021
09a4334
Remove duplicate import
dnephin Mar 2, 2021
e30c33b
changelog: add unreleased entries for v1.9.4
mikemorris Mar 4, 2021
8e83ff3
update bindata_assetfs.go
hashicorp-ci Mar 4, 2021
e02e11d
Release v1.9.4
hashicorp-ci Mar 4, 2021
b11a65a
Putting source back into Dev Mode
hashicorp-ci Mar 5, 2021
8e8bd3a
Merge pull request #9683 from hashicorp/dnephin/fix-zombie-service-dereg
dnephin Feb 19, 2021
c60f10f
Merge pull request #9853 from hashicorp/dnephin/fix-ci-nomad-integ
dnephin Mar 9, 2021
942a424
Merge pull request #9851 from panascais-forks/fix-wan-ipv6-key
dnephin Mar 10, 2021
6365d18
Add units and types to metrics tables (#9674)
rkuska Mar 11, 2021
60efa7f
Merge pull request #9770 from hashicorp/docs/fix-terminating-gateway-…
freddygv Mar 11, 2021
a4b973c
Merge pull request #9869 from DanielMabbett/patch-1
freddygv Mar 11, 2021
5d75c79
Merge pull request #9867 from hashicorp/mw.update-alert-banner
Mar 11, 2021
24d6736
Merge pull request #9874 from hashicorp/mw.patch-docs-issue
Mar 11, 2021
479a901
AutopilotServerHealth now handles the 429 status code (#8599)
mkeeler Mar 12, 2021
caa6465
Small changes to gossip related telemetry docs (#9846)
preetapan Mar 11, 2021
0209a25
Merge pull request #9107 from hashicorp/docs-prepared-query-namespace
freddygv Mar 15, 2021
a1c4564
docs: rename SourceAddress to SourceIP (#9878)
lkysow Mar 15, 2021
f1982a6
Merge pull request #8698 from pierreca/fix-iserreof
dnephin Mar 16, 2021
3b02e02
ui: CSP Improvements (#9847)
johncowen Mar 17, 2021
02822bc
Removing unnecessary comment (#9890)
Mar 18, 2021
ca18755
Add metrics documentation (#9848)
ndhanushkodi Mar 19, 2021
6cd7599
ui: Ensure intention form cancel button works (#9901)
johncowen Mar 19, 2021
ba064ab
docs: Update Helm reference docs (#9904)
ishustava Mar 19, 2021
b1827ee
docs/nia: Update CTS configuration example to not confuse vault provi…
findkim Mar 19, 2021
5a09d8a
introduce certopts (#9606)
hanshasselberg Mar 22, 2021
7611c0d
Retroactive Chagelog update for header fix (#9897)
banks Mar 22, 2021
6dbb324
Update telemetry docs (#9905)
jsosulska Mar 22, 2021
4a0a075
Merge pull request #9838 from Ranjandas/master
Ranjandas Mar 3, 2021
7a7fa06
Merge pull request #9923 from hashicorp/dnephin/fix-ui-config
dnephin Mar 25, 2021
6f72854
Cherrypick NIA doc cross linking (#9928)
danielehc Mar 25, 2021
889cf60
Merge pull request #9917 from Ranjandas/docs/exec-cmd-acl
dnephin Mar 25, 2021
b45cb61
Add Avi Network, AWS ALB and NS1 TF Registies and GitHub links (#9938)
Mar 27, 2021
671543e
Add link to TF module tutorial and example TF modules (#9937)
Mar 29, 2021
0b7eb04
website: add should-build script (#9896)
Mar 29, 2021
f028fc2
nia/docs 0.1.0 ga (#9946)
lornasong Mar 29, 2021
da0f6e7
Docs: add enterprise upgrade link (#9934)
mikegreen Mar 30, 2021
b87ae86
Update header logo and inline icon
dizzyup Mar 31, 2021
2489dbc
Update full logos + layout on loading screen
dizzyup Mar 31, 2021
1c02b2d
Update favicon assets and strategy
dizzyup Mar 31, 2021
5379709
Removes unused favicon/meta assets
dizzyup Mar 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .changelog/8599.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
api: `AutopilotServerHelath` now handles the 429 status code returned by the v1/operator/autopilot/health endpoint and still returned the parsed reply which will indicate server healthiness
```
3 changes: 3 additions & 0 deletions .changelog/9320.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
replication: Correctly log all replication warnings that should not be suppressed
```
3 changes: 3 additions & 0 deletions .changelog/9428.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
connect: connect CA Roots in the primary datacenter should use a SigningKeyID derived from their local intermediate
```
3 changes: 3 additions & 0 deletions .changelog/9650.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
xds: deduplicate mesh gateway listeners by address in a stable way to prevent some LDS churn
```
3 changes: 3 additions & 0 deletions .changelog/9651.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
xds: prevent LDS flaps in mesh gateways due to unstable datacenter lists; also prevent some flaps in terminating gateways as well
```
3 changes: 3 additions & 0 deletions .changelog/9683.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-notes:improvement
client: when a client agent is attempting to dereigster a service, anddoes not have access to the ACL token used to register a service, attempt to use the agent token instead of the default user token. If no agent token is set, fall back to the default user token.
```
3 changes: 3 additions & 0 deletions .changelog/9689.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
proxycfg: avoid potential deadlock in delivering proxy snapshot to watchers.
```
3 changes: 3 additions & 0 deletions .changelog/9715.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fixed a bug in older browsers relating to String.replaceAll and fieldset w/flexbox usage
```
3 changes: 3 additions & 0 deletions .changelog/9737.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
connect: update supported envoy point releases to 1.16.2, 1.15.3, 1.14.6, 1.13.7
```
3 changes: 3 additions & 0 deletions .changelog/9738.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cache: Prevent spamming the logs for days when a cached request encounters an "ACL not found" error.
```
3 changes: 3 additions & 0 deletions .changelog/9749.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Exclude proxies when showing the total number of instances on a node.
```
3 changes: 3 additions & 0 deletions .changelog/9752.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
api: Remove trailing periods from the gateway internal HTTP API endpoint
```
3 changes: 3 additions & 0 deletions .changelog/9765.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
xds: only try to create an ipv6 expose checks listener if ipv6 is supported by the kernel
```
4 changes: 4 additions & 0 deletions .changelog/9772.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:bug
streaming: fixes a bug caused by caching an incorrect snapshot, that would cause clients
to error until the cache expired.
```
3 changes: 3 additions & 0 deletions .changelog/9806.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
connect: if the token given to the vault provider returns no data avoid a panic
```
3 changes: 3 additions & 0 deletions .changelog/9847.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: support stricter content security policies
```
3 changes: 3 additions & 0 deletions .changelog/9851.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
config: correct config key from `advertise_addr_ipv6` to `advertise_addr_wan_ipv6`
```
3 changes: 3 additions & 0 deletions .changelog/9901.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix intention form cancel button
```
3 changes: 3 additions & 0 deletions .changelog/9923.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-notes:bug
http: fix a bug in Consul Enterprise that would cause the UI to believe namespaces were supported, resulting in warning logs and incorrect UI behaviour.
```
30 changes: 15 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -510,13 +510,13 @@ jobs:
- run: *notify-slack-failure

# run integration tests on nomad/master
nomad-integration-master:
nomad-integration-main:
docker:
- image: *GOLANG_IMAGE
environment:
<<: *ENVIRONMENT
NOMAD_WORKING_DIR: /go/src/github.com/hashicorp/nomad
NOMAD_VERSION: master
NOMAD_VERSION: main
steps: *NOMAD_INTEGRATION_TEST_STEPS

build-website-docker-image:
Expand Down Expand Up @@ -755,14 +755,14 @@ jobs:
command: bash <(curl -s https://codecov.io/bash) -v -c -C $CIRCLE_SHA1 -F ui
- run: *notify-slack-failure

envoy-integration-test-1_13_6: &ENVOY_TESTS
envoy-integration-test-1_13_7: &ENVOY_TESTS
docker:
# We only really need bash and docker-compose which is installed on all
# Circle images but pick Go since we have to pick one of them.
- image: *GOLANG_IMAGE
parallelism: 2
environment:
ENVOY_VERSION: "1.13.6"
ENVOY_VERSION: "1.13.7"
steps: &ENVOY_INTEGRATION_TEST_STEPS
- checkout
# Get go binary from workspace
Expand Down Expand Up @@ -795,20 +795,20 @@ jobs:
path: *TEST_RESULTS_DIR
- run: *notify-slack-failure

envoy-integration-test-1_14_5:
envoy-integration-test-1_14_6:
<<: *ENVOY_TESTS
environment:
ENVOY_VERSION: "1.14.5"
ENVOY_VERSION: "1.14.6"

envoy-integration-test-1_15_2:
envoy-integration-test-1_15_3:
<<: *ENVOY_TESTS
environment:
ENVOY_VERSION: "1.15.2"
ENVOY_VERSION: "1.15.3"

envoy-integration-test-1_16_0:
envoy-integration-test-1_16_2:
<<: *ENVOY_TESTS
environment:
ENVOY_VERSION: "1.16.0"
ENVOY_VERSION: "1.16.2"

# run integration tests for the connect ca providers
test-connect-ca-providers:
Expand Down Expand Up @@ -939,22 +939,22 @@ workflows:
- dev-upload-docker:
<<: *dev-upload
context: consul-ci
- nomad-integration-master:
- nomad-integration-main:
requires:
- dev-build
- nomad-integration-0_8:
requires:
- dev-build
- envoy-integration-test-1_13_6:
- envoy-integration-test-1_13_7:
requires:
- dev-build
- envoy-integration-test-1_14_5:
- envoy-integration-test-1_14_6:
requires:
- dev-build
- envoy-integration-test-1_15_2:
- envoy-integration-test-1_15_3:
requires:
- dev-build
- envoy-integration-test-1_16_0:
- envoy-integration-test-1_16_2:
requires:
- dev-build
website:
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## UNRELEASED

## 1.9.4 (March 04, 2021)

IMPROVEMENTS:

* connect: if the token given to the vault provider returns no data avoid a panic [[GH-9806](https://github.com/hashicorp/consul/issues/9806)]
* connect: update supported envoy point releases to 1.16.2, 1.15.3, 1.14.6, 1.13.7 [[GH-9737](https://github.com/hashicorp/consul/issues/9737)]
* xds: only try to create an ipv6 expose checks listener if ipv6 is supported by the kernel [[GH-9765](https://github.com/hashicorp/consul/issues/9765)]

BUG FIXES:

* api: Remove trailing periods from the gateway internal HTTP API endpoint [[GH-9752](https://github.com/hashicorp/consul/issues/9752)]
* cache: Prevent spamming the logs for days when a cached request encounters an "ACL not found" error. [[GH-9738](https://github.com/hashicorp/consul/issues/9738)]
* connect: connect CA Roots in the primary datacenter should use a SigningKeyID derived from their local intermediate [[GH-9428](https://github.com/hashicorp/consul/issues/9428)]
* proxycfg: avoid potential deadlock in delivering proxy snapshot to watchers. [[GH-9689](https://github.com/hashicorp/consul/issues/9689)]
* replication: Correctly log all replication warnings that should not be suppressed [[GH-9320](https://github.com/hashicorp/consul/issues/9320)]
* streaming: fixes a bug caused by caching an incorrect snapshot, that would cause clients
to error until the cache expired. [[GH-9772](https://github.com/hashicorp/consul/issues/9772)]
* ui: Exclude proxies when showing the total number of instances on a node. [[GH-9749](https://github.com/hashicorp/consul/issues/9749)]
* ui: Fixed a bug in older browsers relating to String.replaceAll and fieldset w/flexbox usage [[GH-9715](https://github.com/hashicorp/consul/issues/9715)]
* xds: deduplicate mesh gateway listeners by address in a stable way to prevent some LDS churn [[GH-9650](https://github.com/hashicorp/consul/issues/9650)]
* xds: prevent LDS flaps in mesh gateways due to unstable datacenter lists; also prevent some flaps in terminating gateways as well [[GH-9651](https://github.com/hashicorp/consul/issues/9651)]

## 1.9.3 (February 01, 2021)

FEATURES:
Expand Down Expand Up @@ -172,6 +196,7 @@ BUG FIXES:
* agent: make the json/hcl decoding of ConnectProxyConfig fully work with CamelCase and snake_case [[GH-8741](https://github.com/hashicorp/consul/issues/8741)]
* agent: when enable_central_service_config is enabled ensure agent reload doesn't revert check state to critical [[GH-8747](https://github.com/hashicorp/consul/issues/8747)]
* api: Fixed a bug where the Check.GRPCUseTLS field could not be set using snake case. [[GH-8771](https://github.com/hashicorp/consul/issues/8771)]
* api: Fixed a bug where additional headers configured with `http_config.response_headers` would not be served on index and error pages [[GH-8694](https://github.com/hashicorp/consul/pull/8694/files#diff-160c9abf1b1868a8505065ab02d736fd2dc522a7a555d57383e8428883dc7755R545-R548)]
* autopilot: **(Enterprise Only)** Previously servers in other zones would not be promoted when all servers in a second zone had failed. Now the actual behavior matches the docs and autopilot will promote a healthy non-voter from any zone to replace failure of an entire zone. [[GH-9103](https://github.com/hashicorp/consul/issues/9103)]
* autopilot: Prevent panic when requesting the autopilot health immediately after a leader is elected. [[GH-9204](https://github.com/hashicorp/consul/issues/9204)]
* command: when generating envoy bootstrap configs use the datacenter returned from the agent services endpoint [[GH-9229](https://github.com/hashicorp/consul/issues/9229)]
Expand Down
4 changes: 4 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,14 @@ ifeq ("$(CIRCLECI)","true")
gotestsum --format=short-verbose --junitfile "$(TEST_RESULTS_DIR)/gotestsum-report.xml" -- -cover -coverprofile=coverage.txt ./agent/connect/ca
# Run leader tests that require Vault
gotestsum --format=short-verbose --junitfile "$(TEST_RESULTS_DIR)/gotestsum-report-leader.xml" -- -cover -coverprofile=coverage-leader.txt -run TestLeader_Vault_ ./agent/consul
# Run agent tests that require Vault
gotestsum --format=short-verbose --junitfile "$(TEST_RESULTS_DIR)/gotestsum-report-agent.xml" -- -cover -coverprofile=coverage-agent.txt -run '.*_Vault_' ./agent
else
# Run locally
@echo "Running /agent/connect/ca tests in verbose mode"
@go test -v ./agent/connect/ca
@go test -v ./agent/consul -run 'TestLeader_Vault_'
@go test -v ./agent -run '.*_Vault_'
endif

proto: $(PROTOGOFILES) $(PROTOGOBINFILES)
Expand Down
126 changes: 126 additions & 0 deletions agent/agent_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/hashicorp/consul/acl"
"github.com/hashicorp/consul/agent/config"
"github.com/hashicorp/consul/agent/connect"
"github.com/hashicorp/consul/agent/connect/ca"
"github.com/hashicorp/consul/agent/debug"
"github.com/hashicorp/consul/agent/local"
"github.com/hashicorp/consul/agent/structs"
Expand Down Expand Up @@ -5446,6 +5447,131 @@ func TestAgentConnectCALeafCert_goodNotLocal(t *testing.T) {
}
}

func TestAgentConnectCALeafCert_Vault_doesNotChurnLeafCertsAtIdle(t *testing.T) {
ca.SkipIfVaultNotPresent(t)

if testing.Short() {
t.Skip("too slow for testing.Short")
}

t.Parallel()

testVault := ca.NewTestVaultServer(t)
defer testVault.Stop()

assert := assert.New(t)
require := require.New(t)
a := StartTestAgent(t, TestAgent{Overrides: fmt.Sprintf(`
connect {
test_ca_leaf_root_change_spread = "1ns"
ca_provider = "vault"
ca_config {
address = %[1]q
token = %[2]q
root_pki_path = "pki-root/"
intermediate_pki_path = "pki-intermediate/"
}
}
`, testVault.Addr, testVault.RootToken)})
defer a.Shutdown()
testrpc.WaitForTestAgent(t, a.RPC, "dc1")
testrpc.WaitForActiveCARoot(t, a.RPC, "dc1", nil)

var ca1 *structs.CARoot
{
args := &structs.DCSpecificRequest{Datacenter: "dc1"}
var reply structs.IndexedCARoots
require.NoError(a.RPC("ConnectCA.Roots", args, &reply))
for _, r := range reply.Roots {
if r.ID == reply.ActiveRootID {
ca1 = r
break
}
}
require.NotNil(ca1)
}

{
// Register a local service
args := &structs.ServiceDefinition{
ID: "foo",
Name: "test",
Address: "127.0.0.1",
Port: 8000,
Check: structs.CheckType{
TTL: 15 * time.Second,
},
}
req, _ := http.NewRequest("PUT", "/v1/agent/service/register", jsonReader(args))
resp := httptest.NewRecorder()
_, err := a.srv.AgentRegisterService(resp, req)
require.NoError(err)
if !assert.Equal(200, resp.Code) {
t.Log("Body: ", resp.Body.String())
}
}

// List
req, _ := http.NewRequest("GET", "/v1/agent/connect/ca/leaf/test", nil)
resp := httptest.NewRecorder()
obj, err := a.srv.AgentConnectCALeafCert(resp, req)
require.NoError(err)
require.Equal("MISS", resp.Header().Get("X-Cache"))

// Get the issued cert
issued, ok := obj.(*structs.IssuedCert)
assert.True(ok)

// Verify that the cert is signed by the CA
requireLeafValidUnderCA(t, issued, ca1)

// Verify blocking index
assert.True(issued.ModifyIndex > 0)
assert.Equal(fmt.Sprintf("%d", issued.ModifyIndex),
resp.Header().Get("X-Consul-Index"))

// Test caching
{
// Fetch it again
resp := httptest.NewRecorder()
obj2, err := a.srv.AgentConnectCALeafCert(resp, req)
require.NoError(err)
require.Equal(obj, obj2)

// Should cache hit this time and not make request
require.Equal("HIT", resp.Header().Get("X-Cache"))
}

// Test that we aren't churning leaves for no reason at idle.
{
ch := make(chan error, 1)
go func() {
req, _ := http.NewRequest("GET", "/v1/agent/connect/ca/leaf/test?index="+strconv.Itoa(int(issued.ModifyIndex)), nil)
resp := httptest.NewRecorder()
obj, err := a.srv.AgentConnectCALeafCert(resp, req)
if err != nil {
ch <- err
} else {
issued2 := obj.(*structs.IssuedCert)
if issued.CertPEM == issued2.CertPEM {
ch <- fmt.Errorf("leaf woke up unexpectedly with same cert")
} else {
ch <- fmt.Errorf("leaf woke up unexpectedly with new cert")
}
}
}()

start := time.Now()

select {
case <-time.After(5 * time.Second):
case err := <-ch:
dur := time.Since(start)
t.Fatalf("unexpected return from blocking query; leaf churned during idle period, took %s: %v", dur, err)
}
}
}

func TestAgentConnectCALeafCert_secondaryDC_good(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion agent/cache-types/streaming_health_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type StreamingHealthServices struct {
// so using a shorter TTL ensures the cache entry expires sooner.
func (c *StreamingHealthServices) RegisterOptions() cache.RegisterOptions {
opts := c.RegisterOptionsBlockingRefresh.RegisterOptions()
opts.LastGetTTL = 10 * time.Minute
opts.LastGetTTL = 20 * time.Minute
return opts
}

Expand Down
Loading