observatorium / thanos-receive-controller

Kubernetes controller to automatically configure Thanos receive hashrings
Apache License 2.0
96 stars 46 forks source link

Dependency version warning #99

Open Ben131-Go opened 1 year ago

Ben131-Go commented 1 year ago

Dependency line:

github.com/observatorium/thanos-receive-controller --> github.com/thanos-io/thanos --> github.com/bradfitz/gomemcache
github.com/thanos-io/thanos v0.25.2 --> github.com/bradfitz/gomemcache 24332e2
https://github.com/thanos-io/thanos/blob/v0.25.2/go.mod#L210

Background

Repo github.com/thanos-io/thanos at version v0.25.2 uses replace directive to pin dependency github.com/bradfitz/gomemcache to version 24332e2.
According to Go Modules wikis, replace directives in modules other than the main module are ignored when building the main module. It means such replace usage in dependency's go.mod cannot be inherited when building main module. And it turns out that observatorium/thanos-receive-controller indirectly relies on bradfitz/gomemcache@a41fca8, which is different from the pinned version thanos-io/thanos needed.

https://github.com/observatorium/thanos-receive-controller/blob/master/go.mod(Line 26)

github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect

https://github.com/thanos-io/thanos/blob/v0.25.2/go.mod(line 18&210)

github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
github.com/bradfitz/gomemcache => github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab

So this is just a reminder in the hope that you can notice such an inconsistency.

Solution

1. Bump the version of dependency github.com/thanos-io/thanos

You may try upgrading dependency github.com/thanos-io/thanos to a newer version, which may have eliminated the use of this directive.

2. Add the same replace rule to your go.mod

replace github.com/bradfitz/gomemcache => github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab