thanos-io / kube-thanos

Kubernetes specific configuration for deploying Thanos.
Apache License 2.0
521 stars 176 forks source link

store: fix error when bucket cache not used #176

Closed craigfurman closed 3 years ago

craigfurman commented 3 years ago

Changes

store: fix error when bucket cache not used

The default bucketCache is {}, which caused a runtime error when trying to access the type field.

I only encountered this error when using thanos.storeShards(), not when using thanos.store(). I am not sure why this is, the code looks as though it should produce this error in store() too, if config.bucketCache is unset (and defaults to {}).

It looks like https://github.com/thanos-io/kube-thanos/pull/171 fixed a similar problem with query-frontend cache config.

Verification

I've tested this locally (in k3d) with no explicit config.bucketCache, and one with type: memcached.

metalmatze commented 3 years ago

I'm wondering if this is something wrong in storeShards then. The idea is, that if an object is passed to bucketCache it has to have a type field.

metalmatze commented 3 years ago

Hm. I cannot see anything particularly wrong in the storeShard. I guess I'll go ahead with this to unblock you. Thanks!