gardener / gardener-discovery-server

A server capable of serving public metadata regarding Gardener resources like the shoot OIDC discovery documents
Apache License 2.0
0 stars 3 forks source link

Evaluate the use of CertWatcher to replace internal implementation #9

Open dimityrmirchev opened 5 months ago

dimityrmirchev commented 5 months ago

What would you like to be added: Evaluate replacing internal/dynamiccert with sigs.k8s.io/controller-runtime/pkg/certwatcher.

I tried directly replacing it without investing too much time, but did not get it to work. Once a certificate is removed and replaced with a new one the watcher no longer watches the filepath.

{"level":"error","ts":"2024-04-25T08:41:14.447+0300","logger":"controller-runtime.certwatcher","msg":"error re-watching file","error":"lstat example/local/certs/tls.key: no such file or directory","stacktrace":"sigs.k8s.io/controller-runtime/pkg/certwatcher.(*CertWatcher).handleEvent\n\t/Users/someuser/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/certwatcher/certwatcher.go:185\nsigs.k8s.io/controller-runtime/pkg/certwatcher.(*CertWatcher).Watch\n\t/Users/someuser/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/certwatcher/certwatcher.go:133"}
{"level":"error","ts":"2024-04-25T08:41:14.448+0300","logger":"controller-runtime.certwatcher","msg":"error re-reading certificate","error":"open ./example/local/certs/tls.key: no such file or directory","stacktrace":"sigs.k8s.io/controller-runtime/pkg/certwatcher.(*CertWatcher).handleEvent\n\t/Users/someuser/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/certwatcher/certwatcher.go:190\nsigs.k8s.io/controller-runtime/pkg/certwatcher.(*CertWatcher).Watch\n\t/Users/someuser/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/certwatcher/certwatcher.go:133"}

It is possible that this is related to https://github.com/kubernetes-sigs/controller-runtime/issues/1719

Why is this needed: So we maintain less code.

gardener-ci-robot commented 2 months ago

The Gardener project currently lacks enough active contributors to adequately respond to all issues. This bot triages issues according to the following rules:

You can:

/lifecycle stale