Commit db510fcc authored by Geoff Simmons's avatar Geoff Simmons

Add watcher.GetFiles(), so that the REST API can use the same object.

parent a0903929
......@@ -105,6 +105,7 @@ type Watcher struct {
ctx context.Context
cancel context.CancelFunc
getter *crt.Getter
files *pem.Files
}
// NewWatcher creates an API client.
......@@ -154,8 +155,8 @@ func NewWatcher(
watcher.informer.AddEventHandler(evtFuncs)
watcher.getter = crt.NewGetter(lister)
files := pem.NewFiles(base, gid, watcher.getter)
watcher.nsQs = NewNamespaceQueues(watcher.log, files, recorder)
watcher.files = pem.NewFiles(base, gid, watcher.getter)
watcher.nsQs = NewNamespaceQueues(watcher.log, watcher.files, recorder)
// InitMetrics()
......@@ -169,6 +170,11 @@ func (watcher *Watcher) GetCrtGetter() *crt.Getter {
return watcher.getter
}
// GetFiles returns a pem.Files that manages PEM files and their metadata.
func (watcher *Watcher) GetFiles() *pem.Files {
return watcher.files
}
func (watcher *Watcher) getSecret(obj interface{}) (*api_v1.Secret, bool) {
secret, ok := obj.(*api_v1.Secret)
if !ok {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment