cli: iam destroy (#946)

This commit is contained in:
miampf 2023-02-24 11:36:41 +01:00 committed by GitHub
parent f1b331bbbd
commit 5137e9fa57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 659 additions and 9 deletions

View file

@ -14,6 +14,7 @@ import (
"github.com/edgelesssys/constellation/v2/cli/internal/terraform"
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
"github.com/edgelesssys/constellation/v2/internal/config"
tfjson "github.com/hashicorp/terraform-json"
"go.uber.org/goleak"
)
@ -30,14 +31,17 @@ type stubTerraformClient struct {
initSecret string
iamOutput terraform.IAMOutput
uid string
tfjsonState *tfjson.State
cleanUpWorkspaceCalled bool
removeInstallerCalled bool
destroyCalled bool
showCalled bool
createClusterErr error
destroyErr error
prepareWorkspaceErr error
cleanUpWorkspaceErr error
iamOutputErr error
showErr error
}
func (c *stubTerraformClient) CreateCluster(ctx context.Context) (terraform.CreateOutput, error) {
@ -70,6 +74,11 @@ func (c *stubTerraformClient) RemoveInstaller() {
c.removeInstallerCalled = true
}
func (c *stubTerraformClient) Show(ctx context.Context) (*tfjson.State, error) {
c.showCalled = true
return c.tfjsonState, c.showErr
}
type stubLibvirtRunner struct {
startCalled bool
stopCalled bool