Skip to content

Commit

Permalink
Fix template tests
Browse files Browse the repository at this point in the history
The signature for the `agent.NewDependencyManager` function has changed
because of CSI support. Adds an empty FakePluginGetter to this
constructor so that the tests compile.

Signed-off-by: Drew Erny <[email protected]>
  • Loading branch information
dperny committed Jul 27, 2021
1 parent 2295a13 commit fb51b39
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions template/getter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/docker/swarmkit/agent"
"github.com/docker/swarmkit/api"
"github.com/docker/swarmkit/testutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -270,7 +271,9 @@ func TestTemplatedSecret(t *testing.T) {
for _, testCase := range testCases {
templatedSecret.Spec = testCase.secretSpec

dependencyManager := agent.NewDependencyManager()
// just add an empty FakePluginGetter so that the tests work. We don't
// need to actually use it.
dependencyManager := agent.NewDependencyManager(&testutils.FakePluginGetter{})
dependencyManager.Secrets().Add(*templatedSecret, *referencedSecret)
dependencyManager.Configs().Add(*referencedConfig)

Expand Down Expand Up @@ -550,7 +553,7 @@ func TestTemplatedConfig(t *testing.T) {
for _, testCase := range testCases {
templatedConfig.Spec = testCase.configSpec

dependencyManager := agent.NewDependencyManager()
dependencyManager := agent.NewDependencyManager(&testutils.FakePluginGetter{})
dependencyManager.Configs().Add(*templatedConfig, *referencedConfig)
dependencyManager.Secrets().Add(*referencedSecret)

Expand Down

0 comments on commit fb51b39

Please sign in to comment.