Refactor stack command/package
- 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>
This commit is contained in:
@ -41,6 +41,14 @@ func fakeClientForRemoveStackTest(version string) *fakeClient {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoveWithEmptyName(t *testing.T) {
|
||||
cmd := newRemoveCommand(test.NewFakeCli(&fakeClient{}), &orchestrator)
|
||||
cmd.SetArgs([]string{"good", "' '", "alsogood"})
|
||||
cmd.SetOutput(ioutil.Discard)
|
||||
|
||||
assert.ErrorContains(t, cmd.Execute(), `invalid stack name: "' '"`)
|
||||
}
|
||||
|
||||
func TestRemoveStackVersion124DoesNotRemoveConfigsOrSecrets(t *testing.T) {
|
||||
client := fakeClientForRemoveStackTest("1.24")
|
||||
cmd := newRemoveCommand(test.NewFakeCli(client), &orchestrator)
|
||||
|
||||
Reference in New Issue
Block a user