From f843c09dd15ca4982e60fa12dea48c8f7d7e0373 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 9 Sep 2019 16:09:53 -0400 Subject: [PATCH] Move renewer to internal package so tests don't barf --- command/agent/{ => agentint}/renewer.go | 2 +- command/agent/auth/auth.go | 6 +++--- command/agent/cache/lease_cache.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename command/agent/{ => agentint}/renewer.go (99%) diff --git a/command/agent/renewer.go b/command/agent/agentint/renewer.go similarity index 99% rename from command/agent/renewer.go rename to command/agent/agentint/renewer.go index 836bc61d3a..3f280f6088 100644 --- a/command/agent/renewer.go +++ b/command/agent/agentint/renewer.go @@ -1,4 +1,4 @@ -package agent +package agentint import ( "errors" diff --git a/command/agent/auth/auth.go b/command/agent/auth/auth.go index 0a291b79a1..7111bab93e 100644 --- a/command/agent/auth/auth.go +++ b/command/agent/auth/auth.go @@ -7,7 +7,7 @@ import ( hclog "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/api" - "github.com/hashicorp/vault/command/agent" + "github.com/hashicorp/vault/command/agent/agentint" "github.com/hashicorp/vault/sdk/helper/jsonutil" ) @@ -100,7 +100,7 @@ func (ah *AuthHandler) Run(ctx context.Context, am AuthMethod) { credCh = make(chan struct{}) } - var renewer *agent.Renewer + var renewer *agentint.Renewer for { select { @@ -197,7 +197,7 @@ func (ah *AuthHandler) Run(ctx context.Context, am AuthMethod) { renewer.Stop() } - renewer, err = agent.NewRenewer(ah.client, &agent.RenewerInput{ + renewer, err = agentint.NewRenewer(ah.client, &agentint.RenewerInput{ Secret: secret, }) if err != nil { diff --git a/command/agent/cache/lease_cache.go b/command/agent/cache/lease_cache.go index 3780831b42..a03534d316 100644 --- a/command/agent/cache/lease_cache.go +++ b/command/agent/cache/lease_cache.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/errwrap" hclog "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/api" - "github.com/hashicorp/vault/command/agent" + "github.com/hashicorp/vault/command/agent/agentint" cachememdb "github.com/hashicorp/vault/command/agent/cache/cachememdb" "github.com/hashicorp/vault/helper/namespace" nshelper "github.com/hashicorp/vault/helper/namespace" @@ -395,7 +395,7 @@ func (c *LeaseCache) startRenewing(ctx context.Context, index *cachememdb.Index, client.SetToken(req.Token) client.SetHeaders(req.Request.Header) - renewer, err := agent.NewRenewer(client, &agent.RenewerInput{ + renewer, err := agentint.NewRenewer(client, &agentint.RenewerInput{ Secret: secret, }) if err != nil {