cli/command/swarm: remove uses of pkg/errors in tests
While there may be reasons to keep pkg/errors in production code, we don't need them for these tests. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
8b09ee1e12
commit
694d248001
@ -1,6 +1,7 @@
|
|||||||
package swarm
|
package swarm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
@ -8,7 +9,6 @@ import (
|
|||||||
"github.com/docker/cli/internal/test"
|
"github.com/docker/cli/internal/test"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/swarm"
|
"github.com/docker/docker/api/types/swarm"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/golden"
|
"gotest.tools/v3/golden"
|
||||||
)
|
)
|
||||||
@ -26,28 +26,28 @@ func TestSwarmInitErrorOnAPIFailure(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "init-failed",
|
name: "init-failed",
|
||||||
swarmInitFunc: func() (string, error) {
|
swarmInitFunc: func() (string, error) {
|
||||||
return "", errors.Errorf("error initializing the swarm")
|
return "", errors.New("error initializing the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error initializing the swarm",
|
expectedError: "error initializing the swarm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "init-failed-with-ip-choice",
|
name: "init-failed-with-ip-choice",
|
||||||
swarmInitFunc: func() (string, error) {
|
swarmInitFunc: func() (string, error) {
|
||||||
return "", errors.Errorf("could not choose an IP address to advertise")
|
return "", errors.New("could not choose an IP address to advertise")
|
||||||
},
|
},
|
||||||
expectedError: "could not choose an IP address to advertise - specify one with --advertise-addr",
|
expectedError: "could not choose an IP address to advertise - specify one with --advertise-addr",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "swarm-inspect-after-init-failed",
|
name: "swarm-inspect-after-init-failed",
|
||||||
swarmInspectFunc: func() (swarm.Swarm, error) {
|
swarmInspectFunc: func() (swarm.Swarm, error) {
|
||||||
return swarm.Swarm{}, errors.Errorf("error inspecting the swarm")
|
return swarm.Swarm{}, errors.New("error inspecting the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error inspecting the swarm",
|
expectedError: "error inspecting the swarm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "node-inspect-after-init-failed",
|
name: "node-inspect-after-init-failed",
|
||||||
nodeInspectFunc: func() (swarm.Node, []byte, error) {
|
nodeInspectFunc: func() (swarm.Node, []byte, error) {
|
||||||
return swarm.Node{}, []byte{}, errors.Errorf("error inspecting the node")
|
return swarm.Node{}, []byte{}, errors.New("error inspecting the node")
|
||||||
},
|
},
|
||||||
expectedError: "error inspecting the node",
|
expectedError: "error inspecting the node",
|
||||||
},
|
},
|
||||||
@ -57,7 +57,7 @@ func TestSwarmInitErrorOnAPIFailure(t *testing.T) {
|
|||||||
flagAutolock: "true",
|
flagAutolock: "true",
|
||||||
},
|
},
|
||||||
swarmGetUnlockKeyFunc: func() (types.SwarmUnlockKeyResponse, error) {
|
swarmGetUnlockKeyFunc: func() (types.SwarmUnlockKeyResponse, error) {
|
||||||
return types.SwarmUnlockKeyResponse{}, errors.Errorf("error getting swarm unlock key")
|
return types.SwarmUnlockKeyResponse{}, errors.New("error getting swarm unlock key")
|
||||||
},
|
},
|
||||||
expectedError: "could not fetch unlock key: error getting swarm unlock key",
|
expectedError: "could not fetch unlock key: error getting swarm unlock key",
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package swarm
|
package swarm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@ -8,7 +9,6 @@ import (
|
|||||||
"github.com/docker/cli/internal/test"
|
"github.com/docker/cli/internal/test"
|
||||||
"github.com/docker/docker/api/types/swarm"
|
"github.com/docker/docker/api/types/swarm"
|
||||||
"github.com/docker/docker/api/types/system"
|
"github.com/docker/docker/api/types/system"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
is "gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
@ -34,7 +34,7 @@ func TestSwarmJoinErrors(t *testing.T) {
|
|||||||
name: "join-failed",
|
name: "join-failed",
|
||||||
args: []string{"remote"},
|
args: []string{"remote"},
|
||||||
swarmJoinFunc: func() error {
|
swarmJoinFunc: func() error {
|
||||||
return errors.Errorf("error joining the swarm")
|
return errors.New("error joining the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error joining the swarm",
|
expectedError: "error joining the swarm",
|
||||||
},
|
},
|
||||||
@ -42,7 +42,7 @@ func TestSwarmJoinErrors(t *testing.T) {
|
|||||||
name: "join-failed-on-init",
|
name: "join-failed-on-init",
|
||||||
args: []string{"remote"},
|
args: []string{"remote"},
|
||||||
infoFunc: func() (system.Info, error) {
|
infoFunc: func() (system.Info, error) {
|
||||||
return system.Info{}, errors.Errorf("error asking for node info")
|
return system.Info{}, errors.New("error asking for node info")
|
||||||
},
|
},
|
||||||
expectedError: "error asking for node info",
|
expectedError: "error asking for node info",
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package swarm
|
package swarm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
@ -9,7 +10,6 @@ import (
|
|||||||
"github.com/docker/cli/internal/test/builders"
|
"github.com/docker/cli/internal/test/builders"
|
||||||
"github.com/docker/docker/api/types/swarm"
|
"github.com/docker/docker/api/types/swarm"
|
||||||
"github.com/docker/docker/api/types/system"
|
"github.com/docker/docker/api/types/system"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/golden"
|
"gotest.tools/v3/golden"
|
||||||
)
|
)
|
||||||
@ -43,7 +43,7 @@ func TestSwarmJoinTokenErrors(t *testing.T) {
|
|||||||
name: "swarm-inspect-failed",
|
name: "swarm-inspect-failed",
|
||||||
args: []string{"worker"},
|
args: []string{"worker"},
|
||||||
swarmInspectFunc: func() (swarm.Swarm, error) {
|
swarmInspectFunc: func() (swarm.Swarm, error) {
|
||||||
return swarm.Swarm{}, errors.Errorf("error inspecting the swarm")
|
return swarm.Swarm{}, errors.New("error inspecting the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error inspecting the swarm",
|
expectedError: "error inspecting the swarm",
|
||||||
},
|
},
|
||||||
@ -54,7 +54,7 @@ func TestSwarmJoinTokenErrors(t *testing.T) {
|
|||||||
flagRotate: "true",
|
flagRotate: "true",
|
||||||
},
|
},
|
||||||
swarmInspectFunc: func() (swarm.Swarm, error) {
|
swarmInspectFunc: func() (swarm.Swarm, error) {
|
||||||
return swarm.Swarm{}, errors.Errorf("error inspecting the swarm")
|
return swarm.Swarm{}, errors.New("error inspecting the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error inspecting the swarm",
|
expectedError: "error inspecting the swarm",
|
||||||
},
|
},
|
||||||
@ -65,7 +65,7 @@ func TestSwarmJoinTokenErrors(t *testing.T) {
|
|||||||
flagRotate: "true",
|
flagRotate: "true",
|
||||||
},
|
},
|
||||||
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
||||||
return errors.Errorf("error updating the swarm")
|
return errors.New("error updating the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error updating the swarm",
|
expectedError: "error updating the swarm",
|
||||||
},
|
},
|
||||||
@ -73,7 +73,7 @@ func TestSwarmJoinTokenErrors(t *testing.T) {
|
|||||||
name: "node-inspect-failed",
|
name: "node-inspect-failed",
|
||||||
args: []string{"worker"},
|
args: []string{"worker"},
|
||||||
nodeInspectFunc: func() (swarm.Node, []byte, error) {
|
nodeInspectFunc: func() (swarm.Node, []byte, error) {
|
||||||
return swarm.Node{}, []byte{}, errors.Errorf("error inspecting node")
|
return swarm.Node{}, []byte{}, errors.New("error inspecting node")
|
||||||
},
|
},
|
||||||
expectedError: "error inspecting node",
|
expectedError: "error inspecting node",
|
||||||
},
|
},
|
||||||
@ -81,7 +81,7 @@ func TestSwarmJoinTokenErrors(t *testing.T) {
|
|||||||
name: "info-failed",
|
name: "info-failed",
|
||||||
args: []string{"worker"},
|
args: []string{"worker"},
|
||||||
infoFunc: func() (system.Info, error) {
|
infoFunc: func() (system.Info, error) {
|
||||||
return system.Info{}, errors.Errorf("error asking for node info")
|
return system.Info{}, errors.New("error asking for node info")
|
||||||
},
|
},
|
||||||
expectedError: "error asking for node info",
|
expectedError: "error asking for node info",
|
||||||
},
|
},
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package swarm
|
package swarm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/cli/internal/test"
|
"github.com/docker/cli/internal/test"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
is "gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
@ -26,7 +26,7 @@ func TestSwarmLeaveErrors(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "leave-failed",
|
name: "leave-failed",
|
||||||
swarmLeaveFunc: func() error {
|
swarmLeaveFunc: func() error {
|
||||||
return errors.Errorf("error leaving the swarm")
|
return errors.New("error leaving the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error leaving the swarm",
|
expectedError: "error leaving the swarm",
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package swarm
|
package swarm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
@ -9,7 +10,6 @@ import (
|
|||||||
"github.com/docker/cli/internal/test/builders"
|
"github.com/docker/cli/internal/test/builders"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/swarm"
|
"github.com/docker/docker/api/types/swarm"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/golden"
|
"gotest.tools/v3/golden"
|
||||||
)
|
)
|
||||||
@ -35,7 +35,7 @@ func TestSwarmUnlockKeyErrors(t *testing.T) {
|
|||||||
flagRotate: "true",
|
flagRotate: "true",
|
||||||
},
|
},
|
||||||
swarmInspectFunc: func() (swarm.Swarm, error) {
|
swarmInspectFunc: func() (swarm.Swarm, error) {
|
||||||
return swarm.Swarm{}, errors.Errorf("error inspecting the swarm")
|
return swarm.Swarm{}, errors.New("error inspecting the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error inspecting the swarm",
|
expectedError: "error inspecting the swarm",
|
||||||
},
|
},
|
||||||
@ -58,14 +58,14 @@ func TestSwarmUnlockKeyErrors(t *testing.T) {
|
|||||||
return *builders.Swarm(builders.Autolock()), nil
|
return *builders.Swarm(builders.Autolock()), nil
|
||||||
},
|
},
|
||||||
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
||||||
return errors.Errorf("error updating the swarm")
|
return errors.New("error updating the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error updating the swarm",
|
expectedError: "error updating the swarm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "swarm-get-unlock-key-failed",
|
name: "swarm-get-unlock-key-failed",
|
||||||
swarmGetUnlockKeyFunc: func() (types.SwarmUnlockKeyResponse, error) {
|
swarmGetUnlockKeyFunc: func() (types.SwarmUnlockKeyResponse, error) {
|
||||||
return types.SwarmUnlockKeyResponse{}, errors.Errorf("error getting unlock key")
|
return types.SwarmUnlockKeyResponse{}, errors.New("error getting unlock key")
|
||||||
},
|
},
|
||||||
expectedError: "error getting unlock key",
|
expectedError: "error getting unlock key",
|
||||||
},
|
},
|
||||||
@ -88,8 +88,8 @@ func TestSwarmUnlockKeyErrors(t *testing.T) {
|
|||||||
swarmGetUnlockKeyFunc: tc.swarmGetUnlockKeyFunc,
|
swarmGetUnlockKeyFunc: tc.swarmGetUnlockKeyFunc,
|
||||||
}))
|
}))
|
||||||
cmd.SetArgs(tc.args)
|
cmd.SetArgs(tc.args)
|
||||||
for key, value := range tc.flags {
|
for k, v := range tc.flags {
|
||||||
assert.Check(t, cmd.Flags().Set(key, value))
|
assert.Check(t, cmd.Flags().Set(k, v))
|
||||||
}
|
}
|
||||||
cmd.SetOut(io.Discard)
|
cmd.SetOut(io.Discard)
|
||||||
cmd.SetErr(io.Discard)
|
cmd.SetErr(io.Discard)
|
||||||
@ -165,8 +165,8 @@ func TestSwarmUnlockKey(t *testing.T) {
|
|||||||
})
|
})
|
||||||
cmd := newUnlockKeyCommand(cli)
|
cmd := newUnlockKeyCommand(cli)
|
||||||
cmd.SetArgs(tc.args)
|
cmd.SetArgs(tc.args)
|
||||||
for key, value := range tc.flags {
|
for k, v := range tc.flags {
|
||||||
assert.Check(t, cmd.Flags().Set(key, value))
|
assert.Check(t, cmd.Flags().Set(k, v))
|
||||||
}
|
}
|
||||||
assert.NilError(t, cmd.Execute())
|
assert.NilError(t, cmd.Execute())
|
||||||
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("unlockkeys-%s.golden", tc.name))
|
golden.Assert(t, cli.OutBuffer().String(), fmt.Sprintf("unlockkeys-%s.golden", tc.name))
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package swarm
|
package swarm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@ -9,7 +10,6 @@ import (
|
|||||||
"github.com/docker/cli/internal/test"
|
"github.com/docker/cli/internal/test"
|
||||||
"github.com/docker/docker/api/types/swarm"
|
"github.com/docker/docker/api/types/swarm"
|
||||||
"github.com/docker/docker/api/types/system"
|
"github.com/docker/docker/api/types/system"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ func TestSwarmUnlockErrors(t *testing.T) {
|
|||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
swarmUnlockFunc: func(req swarm.UnlockRequest) error {
|
swarmUnlockFunc: func(req swarm.UnlockRequest) error {
|
||||||
return errors.Errorf("error unlocking the swarm")
|
return errors.New("error unlocking the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error unlocking the swarm",
|
expectedError: "error unlocking the swarm",
|
||||||
},
|
},
|
||||||
@ -90,7 +90,7 @@ func TestSwarmUnlock(t *testing.T) {
|
|||||||
},
|
},
|
||||||
swarmUnlockFunc: func(req swarm.UnlockRequest) error {
|
swarmUnlockFunc: func(req swarm.UnlockRequest) error {
|
||||||
if req.UnlockKey != input {
|
if req.UnlockKey != input {
|
||||||
return errors.Errorf("Invalid unlock key")
|
return errors.New("invalid unlock key")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package swarm
|
package swarm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
@ -10,7 +11,6 @@ import (
|
|||||||
"github.com/docker/cli/internal/test/builders"
|
"github.com/docker/cli/internal/test/builders"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/swarm"
|
"github.com/docker/docker/api/types/swarm"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/golden"
|
"gotest.tools/v3/golden"
|
||||||
)
|
)
|
||||||
@ -36,7 +36,7 @@ func TestSwarmUpdateErrors(t *testing.T) {
|
|||||||
flagTaskHistoryLimit: "10",
|
flagTaskHistoryLimit: "10",
|
||||||
},
|
},
|
||||||
swarmInspectFunc: func() (swarm.Swarm, error) {
|
swarmInspectFunc: func() (swarm.Swarm, error) {
|
||||||
return swarm.Swarm{}, errors.Errorf("error inspecting the swarm")
|
return swarm.Swarm{}, errors.New("error inspecting the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error inspecting the swarm",
|
expectedError: "error inspecting the swarm",
|
||||||
},
|
},
|
||||||
@ -46,7 +46,7 @@ func TestSwarmUpdateErrors(t *testing.T) {
|
|||||||
flagTaskHistoryLimit: "10",
|
flagTaskHistoryLimit: "10",
|
||||||
},
|
},
|
||||||
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
||||||
return errors.Errorf("error updating the swarm")
|
return errors.New("error updating the swarm")
|
||||||
},
|
},
|
||||||
expectedError: "error updating the swarm",
|
expectedError: "error updating the swarm",
|
||||||
},
|
},
|
||||||
@ -59,7 +59,7 @@ func TestSwarmUpdateErrors(t *testing.T) {
|
|||||||
return *builders.Swarm(), nil
|
return *builders.Swarm(), nil
|
||||||
},
|
},
|
||||||
swarmGetUnlockKeyFunc: func() (types.SwarmUnlockKeyResponse, error) {
|
swarmGetUnlockKeyFunc: func() (types.SwarmUnlockKeyResponse, error) {
|
||||||
return types.SwarmUnlockKeyResponse{}, errors.Errorf("error getting unlock key")
|
return types.SwarmUnlockKeyResponse{}, errors.New("error getting unlock key")
|
||||||
},
|
},
|
||||||
expectedError: "error getting unlock key",
|
expectedError: "error getting unlock key",
|
||||||
},
|
},
|
||||||
@ -114,33 +114,33 @@ func TestSwarmUpdate(t *testing.T) {
|
|||||||
},
|
},
|
||||||
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
||||||
if *swarm.Orchestration.TaskHistoryRetentionLimit != 10 {
|
if *swarm.Orchestration.TaskHistoryRetentionLimit != 10 {
|
||||||
return errors.Errorf("historyLimit not correctly set")
|
return errors.New("historyLimit not correctly set")
|
||||||
}
|
}
|
||||||
heartbeatDuration, err := time.ParseDuration("10s")
|
heartbeatDuration, err := time.ParseDuration("10s")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if swarm.Dispatcher.HeartbeatPeriod != heartbeatDuration {
|
if swarm.Dispatcher.HeartbeatPeriod != heartbeatDuration {
|
||||||
return errors.Errorf("heartbeatPeriodLimit not correctly set")
|
return errors.New("heartbeatPeriodLimit not correctly set")
|
||||||
}
|
}
|
||||||
certExpiryDuration, err := time.ParseDuration("20s")
|
certExpiryDuration, err := time.ParseDuration("20s")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if swarm.CAConfig.NodeCertExpiry != certExpiryDuration {
|
if swarm.CAConfig.NodeCertExpiry != certExpiryDuration {
|
||||||
return errors.Errorf("certExpiry not correctly set")
|
return errors.New("certExpiry not correctly set")
|
||||||
}
|
}
|
||||||
if len(swarm.CAConfig.ExternalCAs) != 1 || swarm.CAConfig.ExternalCAs[0].CACert != "trustroot" {
|
if len(swarm.CAConfig.ExternalCAs) != 1 || swarm.CAConfig.ExternalCAs[0].CACert != "trustroot" {
|
||||||
return errors.Errorf("externalCA not correctly set")
|
return errors.New("externalCA not correctly set")
|
||||||
}
|
}
|
||||||
if *swarm.Raft.KeepOldSnapshots != 10 {
|
if *swarm.Raft.KeepOldSnapshots != 10 {
|
||||||
return errors.Errorf("keepOldSnapshots not correctly set")
|
return errors.New("keepOldSnapshots not correctly set")
|
||||||
}
|
}
|
||||||
if swarm.Raft.SnapshotInterval != 100 {
|
if swarm.Raft.SnapshotInterval != 100 {
|
||||||
return errors.Errorf("snapshotInterval not correctly set")
|
return errors.New("snapshotInterval not correctly set")
|
||||||
}
|
}
|
||||||
if !swarm.EncryptionConfig.AutoLockManagers {
|
if !swarm.EncryptionConfig.AutoLockManagers {
|
||||||
return errors.Errorf("autolock not correctly set")
|
return errors.New("autolock not correctly set")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
@ -153,7 +153,7 @@ func TestSwarmUpdate(t *testing.T) {
|
|||||||
},
|
},
|
||||||
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
swarmUpdateFunc: func(swarm swarm.Spec, flags swarm.UpdateFlags) error {
|
||||||
if *swarm.Orchestration.TaskHistoryRetentionLimit != 10 {
|
if *swarm.Orchestration.TaskHistoryRetentionLimit != 10 {
|
||||||
return errors.Errorf("historyLimit not correctly set")
|
return errors.New("historyLimit not correctly set")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user