mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-05 07:45:27 -04:00
cli: iam destroy (#946)
This commit is contained in:
parent
f1b331bbbd
commit
5137e9fa57
11 changed files with 659 additions and 9 deletions
|
@ -14,6 +14,7 @@ import (
|
|||
"github.com/edgelesssys/constellation/v2/cli/internal/clusterid"
|
||||
"github.com/edgelesssys/constellation/v2/cli/internal/iamid"
|
||||
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
||||
"github.com/edgelesssys/constellation/v2/internal/cloud/gcpshared"
|
||||
"github.com/edgelesssys/constellation/v2/internal/config"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
|
@ -72,3 +73,21 @@ func (c *stubIAMCreator) Create(
|
|||
c.id.CloudProvider = provider
|
||||
return c.id, c.createErr
|
||||
}
|
||||
|
||||
type stubIAMDestroyer struct {
|
||||
destroyCalled bool
|
||||
getTfstateKeyCalled bool
|
||||
gcpSaKey gcpshared.ServiceAccountKey
|
||||
destroyErr error
|
||||
getTfstateKeyErr error
|
||||
}
|
||||
|
||||
func (d *stubIAMDestroyer) DestroyIAMConfiguration(ctx context.Context) error {
|
||||
d.destroyCalled = true
|
||||
return d.destroyErr
|
||||
}
|
||||
|
||||
func (d *stubIAMDestroyer) GetTfstateServiceAccountKey(ctx context.Context) (gcpshared.ServiceAccountKey, error) {
|
||||
d.getTfstateKeyCalled = true
|
||||
return d.gcpSaKey, d.getTfstateKeyErr
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue