metropolis/pkg/(event|pki): remove dependency to consensus/client
We are currently depending on the consensus client, even when we just
need a plain etcd client. This change removes the dependency by adding
a ThinClient interface that wraps KV amd Watcher from clientv3.
Change-Id: I33994ab35ebb3a63c9dda4b588b7f529535e3083
Reviewed-on: https://review.monogon.dev/c/monogon/+/3082
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/pkg/pki/crl.go b/metropolis/pkg/pki/crl.go
index 23838a1..f72fb2d 100644
--- a/metropolis/pkg/pki/crl.go
+++ b/metropolis/pkg/pki/crl.go
@@ -11,7 +11,6 @@
clientv3 "go.etcd.io/etcd/client/v3"
- "source.monogon.dev/metropolis/node/core/consensus/client"
"source.monogon.dev/metropolis/pkg/event"
"source.monogon.dev/metropolis/pkg/event/etcd"
)
@@ -145,7 +144,7 @@
// WatchCRL returns and Event Value compatible CRLWatcher which can be used to
// retrieve and watch for the newest CRL available from this CA certificate.
-func (c *Certificate) WatchCRL(cl client.Namespaced) event.Watcher[*CRL] {
+func (c *Certificate) WatchCRL(cl etcd.ThinClient) event.Watcher[*CRL] {
value := etcd.NewValue(cl, c.crlPath(), func(_, data []byte) (*CRL, error) {
crl, err := x509.ParseCRL(data)
if err != nil {