open-nomad/api
Seth Hoenig 9a6988f55b deps: adjust to gzip handler zero length response body
After swapping gzip handler to use the gorilla library, we
must account for a quirk in how zero/minimal length response
bodies are delivered.

The previous gzip handler was configured to compress all responses
regardless of size - even if the data was zero length or below the
network MTU. This behavior changed in [v1.1.0](c551b6c3b4 (diff-de723e6602cc2f16f7a9d85fd89d69954edc12a49134dab8901b10ee06d1879d))
which is why we could not upgrade.

The Nomad HTTP Client mutates the http.Response.Body object, making
a strong assumption that if the Content-Encoding header is set to "gzip",
the response will be readable via gzip decoder. This is no longer true
for the nytimes gzip handler, and is also not true for the gorilla gzip
handler.

It seems in practice this only makes a difference on the /v1/operator/license
endpoint which returns an empty response in OSS Nomad.

The fix here is to simply not wrap the response body reader if we
encounter an io.EOF while creating the gzip reader - indicating there
is no data to decode.
2022-01-19 11:52:19 -06:00
..
contexts api: implement fuzzy search API 2021-04-16 16:36:07 -06:00
internal/testutil cleanup: stop referencing depreceted HeaderMap field 2022-01-12 10:32:54 -06:00
acl.go HTTP API support for 'nomad ui -login' 2021-03-10 08:17:56 -05:00
acl_test.go HTTP API support for 'nomad ui -login' 2021-03-10 08:17:56 -05:00
agent.go Make number of scheduler workers reloadable (#11593) 2022-01-06 11:56:13 -05:00
agent_test.go Make number of scheduler workers reloadable (#11593) 2022-01-06 11:56:13 -05:00
allocations.go exec: api: handle closing errors differently 2021-05-25 11:19:42 -04:00
allocations_exec.go add a note about node connection failure and fallback 2021-05-25 14:24:24 -04:00
allocations_test.go api: add Allocation client and server terminal status funcs. 2021-03-25 08:52:59 +01:00
api.go deps: adjust to gzip handler zero length response body 2022-01-19 11:52:19 -06:00
api_test.go deps: adjust to gzip handler zero length response body 2022-01-19 11:52:19 -06:00
compose_test.go test: fix up testing around host networks 2020-06-19 13:53:31 -04:00
constraint.go Tag Job spec with HCLv2 tags 2020-10-21 14:05:46 -04:00
constraint_test.go Parallel 2017-07-21 16:33:04 -07:00
consul.go consul: plubming for specifying consul namespace in job/group 2021-04-05 10:03:19 -06:00
consul_test.go consul: plubming for specifying consul namespace in job/group 2021-04-05 10:03:19 -06:00
csi.go CSI ListSnapshots secrets implementation 2021-07-28 11:30:29 -07:00
csi_test.go csi: add -force flag to volume deregister (#8295) 2020-07-01 12:17:51 -04:00
deployments.go multiregion CLI: nomad deployment unblock 2020-06-17 11:03:44 -04:00
evaluations.go add create and modify timestamps to evaluations (#5881) 2019-08-07 09:50:35 -07:00
evaluations_test.go evaluations list pagination and filtering (#11648) 2021-12-10 13:43:03 -05:00
event_stream.go API: Event stream use full name instead of Eval/Alloc (#9509) 2020-12-03 11:48:18 -05:00
event_stream_test.go Node Drain Metadata (#10250) 2021-05-07 13:58:40 -04:00
fs.go cli: recover from client ACL lookup failures 2019-10-04 11:23:59 -04:00
fs_test.go Divest api/ package of deps elsewhere in the nomad repo. (#5488) 2019-03-29 14:47:40 -04:00
go.mod build(deps): bump github.com/hashicorp/cronexpr from 1.1.0 to 1.1.1 in /api (#11132) 2021-11-17 11:46:48 -05:00
go.sum build(deps): bump github.com/hashicorp/cronexpr from 1.1.0 to 1.1.1 in /api (#11132) 2021-11-17 11:46:48 -05:00
ioutil.go Add api/ package function to save snapshot 2020-05-21 20:04:38 -04:00
ioutil_test.go Add api/ package function to save snapshot 2020-05-21 20:04:38 -04:00
jobs.go provide -no-shutdown-delay flag for job/alloc stop (#11596) 2021-12-13 14:54:53 -05:00
jobs_test.go core: allow setting and propagation of eval priority on job de/registration (#11532) 2021-11-23 09:23:31 +01:00
namespace.go sync 2017-10-13 14:36:02 -07:00
namespace_test.go gofmt all the files 2021-10-01 10:14:28 -04:00
nodes.go cli: ensure -stale flag is respected by nomad operator debug (#11678) 2021-12-15 10:44:03 -05:00
nodes_test.go api: add Node.{Min,Max}DynamicPort 2021-09-30 17:05:10 -07:00
operator.go api: return error when LicenseGet status is not 200 (#11644) 2021-12-14 19:47:09 -05:00
operator_autopilot.go implement MinQuorum 2020-02-16 16:04:59 -06:00
operator_ent_test.go api: return error when LicenseGet status is not 200 (#11644) 2021-12-14 19:47:09 -05:00
operator_metrics.go Metrics gotemplate support, debug bundle features (#9067) 2020-10-14 15:16:10 -04:00
operator_metrics_test.go agent: return req error if prometheus metrics are disabled. 2021-03-09 15:28:58 +01:00
operator_test.go Divest api/ package of deps elsewhere in the nomad repo. (#5488) 2019-03-29 14:47:40 -04:00
quota.go sync 2017-10-13 14:36:02 -07:00
quota_test.go gofmt all the files 2021-10-01 10:14:28 -04:00
raw.go Making the client use tls if the node from which migration has to be made has enabled tls 2016-10-31 10:20:04 -07:00
recommendations.go added new policy capabilities for recommendations API 2020-10-28 14:32:16 +00:00
regions.go cli: ensure -stale flag is respected by nomad operator debug (#11678) 2021-12-15 10:44:03 -05:00
regions_test.go Divest api/ package of deps elsewhere in the nomad repo. (#5488) 2019-03-29 14:47:40 -04:00
resources.go allow configuration of Docker hostnames in bridge mode (#11173) 2021-09-16 08:13:09 +02:00
resources_test.go api: add Resource.Canonicalize test and fix tests to handle ReservedCores field 2021-03-19 22:08:27 -04:00
scaling.go chore: bump golangci-lint from v1.24 to v1.39 2021-04-03 09:50:23 +02:00
scaling_test.go add scaling policy type 2020-09-29 17:57:46 -04:00
search.go api: implement fuzzy search API 2021-04-16 16:36:07 -06:00
search_test.go api: include ent fuzzy struct types in oss 2021-04-20 11:19:38 -06:00
sentinel.go sync 2017-09-19 10:08:23 -05:00
sentinel_test.go gofmt all the files 2021-10-01 10:14:28 -04:00
services.go Enable parsing of terminating gateways 2021-06-30 05:34:16 +00:00
services_test.go consul/connect: fix tests for mesh gateway mode 2021-06-04 09:31:38 -05:00
status.go display server leaders per region 2016-03-17 16:04:09 -07:00
status_test.go Parallel 2017-07-21 16:33:04 -07:00
system.go Add missing ReconcileSummaries API method 2017-08-24 11:55:10 +02:00
system_test.go Parallel 2017-07-21 16:33:04 -07:00
tasks.go Expose Consul template configuration parameters (#11606) 2022-01-10 10:19:07 -05:00
tasks_test.go Expose Consul template configuration parameters (#11606) 2022-01-10 10:19:07 -05:00
util_test.go appease the linter and fix an incorrect test 2021-01-08 19:38:25 +00:00
utils.go more testing for ScalingPolicy, mainly around parsing and canonicalization for Min/Max 2020-03-24 19:43:50 +00:00
utils_test.go api: move formatFloat function 2019-01-18 15:31:31 -05:00