m-lab / etl-gardener

Gardener provides services for maintaining and reprocessing mlab data.
Apache License 2.0
13 stars 5 forks source link

Add v2 client package for accessing gardener Jobs API #385

Closed stephen-soltesz closed 2 years ago

stephen-soltesz commented 2 years ago

This change adds a new all-inclusive v2 client implementation for accessing the gardener Jobs API resources.

The previous jobs API was accessed using a mixture of logic across three packages:

The new version of the Jobs API creates a dedicated client and encapsulates all requests to the v2 API.

Part of:


This change is Reviewable

coveralls commented 2 years ago

Coverage Status

Coverage increased (+1.0%) to 72.543% when pulling 3d4d6498322d4f33535d005d5f7ff925ff2a8bfa on sandbox-soltesz-add-client-v2 into 0b614f2e16d5d950f277e916650fbcf768ff92ea on master.

SaiedKazemi commented 2 years ago

client/v2/client.go line 104 at r1 (raw file):

  }
  defer resp.Body.Close()
  return ioutil.ReadAll(resp.Body)

The ioutil package was deprecated in Go 1.16 (details: https://go.dev/doc/go1.16), so I suggest to change this to io.ReadAll().

SaiedKazemi commented 2 years ago

client/v2/client_test.go line 110 at r1 (raw file):

          c := NewJobClient(*u)
          if tt.corruptTransport {
              // Corrupt the default http transport so that making the reqeust fails.

nit: s/reqeust/request/

SaiedKazemi commented 2 years ago
:lgtm:
SaiedKazemi commented 2 years ago
:lgtm:
stephen-soltesz commented 2 years ago

Thank you!