Skip to content

Commit 42b5a0b

Browse files
committed
remove renewals from secret store interface
1 parent e1872a6 commit 42b5a0b

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

service/secret/memory/memory.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package memory
22

33
import (
4-
"context"
5-
64
"github.com/picostack/picobot/service/secret"
75
)
86

@@ -17,8 +15,3 @@ var _ secret.Store = &MemorySecrets{}
1715
func (v *MemorySecrets) GetSecretsForTarget(name string) (map[string]string, error) {
1816
return v.Secrets, nil
1917
}
20-
21-
// Renew implements secret.Store
22-
func (v *MemorySecrets) Renew(ctx context.Context) error {
23-
return nil
24-
}

service/secret/secret.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package secret
22

3-
import "context"
4-
53
// Store describes a type that can securely obtain secrets for services.
64
type Store interface {
75
GetSecretsForTarget(name string) (map[string]string, error)
8-
Renew(ctx context.Context) error
96
}

service/service.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ func (app *App) Start(ctx context.Context) error {
8585

8686
g.Go(app.watcher.Start)
8787

88-
g.Go(func() error {
89-
return retrier.New(retrier.ConstantBackoff(3, 100*time.Millisecond), nil).
90-
RunCtx(ctx, app.secrets.Renew)
91-
})
88+
if s, ok := app.secrets.(*vault.VaultSecrets); ok {
89+
g.Go(func() error {
90+
return retrier.New(retrier.ConstantBackoff(3, 100*time.Millisecond), nil).
91+
RunCtx(ctx, s.Renew)
92+
})
93+
}
9294

9395
return g.Wait()
9496
}

0 commit comments

Comments
 (0)