2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-04-13 07:01:38 -04:00
|
|
|
package cloudcmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2022-11-22 12:47:08 -05:00
|
|
|
"io"
|
2022-04-13 07:01:38 -04:00
|
|
|
|
2022-09-26 09:52:31 -04:00
|
|
|
"github.com/edgelesssys/constellation/v2/cli/internal/terraform"
|
2022-10-26 09:57:00 -04:00
|
|
|
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
2022-11-22 12:47:08 -05:00
|
|
|
"github.com/edgelesssys/constellation/v2/internal/config"
|
2022-04-13 07:01:38 -04:00
|
|
|
)
|
|
|
|
|
2022-09-27 03:22:29 -04:00
|
|
|
type terraformClient interface {
|
2022-12-07 05:48:54 -05:00
|
|
|
PrepareWorkspace(path string, input terraform.Variables) error
|
2023-01-19 04:41:07 -05:00
|
|
|
CreateCluster(ctx context.Context) (terraform.CreateOutput, error)
|
2022-12-07 05:48:54 -05:00
|
|
|
CreateIAMConfig(ctx context.Context, provider cloudprovider.Provider) (terraform.IAMOutput, error)
|
2022-09-27 03:22:29 -04:00
|
|
|
DestroyCluster(ctx context.Context) error
|
|
|
|
CleanUpWorkspace() error
|
|
|
|
RemoveInstaller()
|
2022-04-13 07:01:38 -04:00
|
|
|
}
|
|
|
|
|
2022-10-05 03:11:30 -04:00
|
|
|
type libvirtRunner interface {
|
|
|
|
Start(ctx context.Context, containerName, imageName string) error
|
|
|
|
Stop(ctx context.Context) error
|
|
|
|
}
|
2022-11-22 12:47:08 -05:00
|
|
|
|
|
|
|
type imageFetcher interface {
|
|
|
|
FetchReference(ctx context.Context, config *config.Config) (string, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type rawDownloader interface {
|
|
|
|
Download(ctx context.Context, errWriter io.Writer, isTTY bool, source, version string) (string, error)
|
|
|
|
}
|