cli: unify cloudcmd create and upgrade code (#2513)

* Unify cloudcmd create and upgrade code
* Make libvirt runner code a bit more idempotent

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-10-31 12:46:40 +01:00 committed by GitHub
parent e8cf0f59bd
commit 625dc26644
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 1041 additions and 1120 deletions

View file

@ -19,7 +19,7 @@ func TestTerminator(t *testing.T) {
someErr := errors.New("failed")
testCases := map[string]struct {
tfClient tfResourceClient
tfClient tfDestroyer
newTfClientErr error
libvirt *stubLibvirtRunner
wantErr bool
@ -55,7 +55,7 @@ func TestTerminator(t *testing.T) {
assert := assert.New(t)
terminator := &Terminator{
newTerraformClient: func(_ context.Context, _ string) (tfResourceClient, error) {
newTerraformClient: func(_ context.Context, _ string) (tfDestroyer, error) {
return tc.tfClient, tc.newTfClientErr
},
newLibvirtRunner: func() libvirtRunner {