rode / grafeas-elasticsearch

An implementation of the Grafeas storage backend based on Elasticsearch
Apache License 2.0
12 stars 5 forks source link

[esutil.Client] Consistently escape document id #90

Closed alexashley closed 3 years ago

alexashley commented 3 years ago

Currently the client was escaping the document id on Get, but not Create, or Update. This was causing documents to be created that couldn't be retrieved by passing the same id to the client.

I also removed the query escaping around the routing value -- it appears that the Elasticsearch client already handles that, so it was being double-encoded (I don't this affected anything since none of the routing values we use need escaping at the moment).

codecov-commenter commented 3 years ago

Codecov Report

Merging #90 (2b8f04d) into main (b22f2e1) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #90      +/-   ##
==========================================
+ Coverage   84.53%   84.54%   +0.01%     
==========================================
  Files           9        9              
  Lines        1015     1016       +1     
==========================================
+ Hits          858      859       +1     
  Misses         93       93              
  Partials       64       64              
Impacted Files Coverage Δ
go/v1beta1/storage/esutil/client.go 82.73% <100.00%> (+0.06%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b22f2e1...2b8f04d. Read the comment docs.