Skip to content

Commit

Permalink
Follow what documentation says we should do if we're a perf standby a…
Browse files Browse the repository at this point in the history
…nd perfstandbyok=true (#7241)

Follow what documentation says we should do if we're a perf standby and perfstandbyok=true, i.e. return 200 instead of 429.
  • Loading branch information
ncabatoff authored Aug 5, 2019
1 parent 6e1360b commit 233ca02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions http/sys_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,14 @@ func getSysHealth(core *vault.Core, r *http.Request) (int, *HealthResponse, erro
code = sealedCode
case replicationState.HasState(consts.ReplicationDRSecondary):
code = drSecondaryCode
case !perfStandbyOK && perfStandby:
code = perfStandbyCode
case !standbyOK && standby:
code = standbyCode
case perfStandby:
if !perfStandbyOK {
code = perfStandbyCode
}
case standby:
if !standbyOK {
code = standbyCode
}
}

// Fetch the local cluster name and identifier
Expand Down
4 changes: 2 additions & 2 deletions website/source/api/system/health.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ The default status codes are:

- `standbyok` `(bool: false)` – Specifies if being a standby should still return
the active status code instead of the standby status code. This is useful when
Vault is behind a non-configurable load balance that just wants a 200-level
Vault is behind a non-configurable load balancer that just wants a 200-level
response. This will not apply if the node is a performance standby.

- `perfstandbyok` `(bool: false)` – Specifies if being a performance standby should
still return the active status code instead of the performance standby status code.
This is useful when Vault is behind a non-configurable load balance that just wants
This is useful when Vault is behind a non-configurable load balancer that just wants
a 200-level response.

- `activecode` `(int: 200)` – Specifies the status code that should be returned
Expand Down

0 comments on commit 233ca02

Please sign in to comment.