cli: enable constellation apply to create new clusters (#2549)

* Allow creation of Constellation clusters using `apply` command
* Add auto-completion for `--skip-phases` flag
* Deprecate create command
* Replace all doc references to create command with apply

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-11-20 11:17:16 +01:00 committed by GitHub
parent 82b68df92a
commit 4c8ce55e5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 989 additions and 636 deletions

View file

@ -27,16 +27,20 @@ func TestMain(m *testing.M) {
}
type stubCloudCreator struct {
state state.Infrastructure
planCalled bool
planErr error
applyCalled bool
applyErr error
state state.Infrastructure
planCalled bool
planDiff bool
planErr error
applyCalled bool
applyErr error
restoreErr error
workspaceIsEmpty bool
workspaceIsEmptyErr error
}
func (c *stubCloudCreator) Plan(_ context.Context, _ *config.Config) (bool, error) {
c.planCalled = true
return false, c.planErr
return c.planDiff, c.planErr
}
func (c *stubCloudCreator) Apply(_ context.Context, _ cloudprovider.Provider, _ cloudcmd.RollbackBehavior) (state.Infrastructure, error) {
@ -45,7 +49,11 @@ func (c *stubCloudCreator) Apply(_ context.Context, _ cloudprovider.Provider, _
}
func (c *stubCloudCreator) RestoreWorkspace() error {
return nil
return c.restoreErr
}
func (c *stubCloudCreator) WorkingDirIsEmpty() (bool, error) {
return c.workspaceIsEmpty, c.workspaceIsEmptyErr
}
type stubCloudTerminator struct {