- Handle `bundlefile` directly in the `top-level` command. `bundlefile` is still experimental and will be deprecated in future version — this should make be easier to remove it. - Validate the `stack` name in all cases (i.e. whatever the orchestrator is used) - Load the composefile ahead of choosing the orchestrator. This removes some slight duplication. - Makes `RunDeploy` easier to use from outside packages (like `docker/app`) with a preloaded configuration. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
18 lines
358 B
Go
18 lines
358 B
Go
package stack
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"testing"
|
|
|
|
"github.com/docker/cli/internal/test"
|
|
"gotest.tools/assert"
|
|
)
|
|
|
|
func TestDeployWithEmptyName(t *testing.T) {
|
|
cmd := newDeployCommand(test.NewFakeCli(&fakeClient{}), nil)
|
|
cmd.SetArgs([]string{"' '"})
|
|
cmd.SetOutput(ioutil.Discard)
|
|
|
|
assert.ErrorContains(t, cmd.Execute(), `invalid stack name: "' '"`)
|
|
}
|