cli: refactor terraform code to be update/create agnostic (#2501)

* Move upgrade specific functions out of Terraform module
* Always allow overwriting Terraform files
* Ensure constellation-terraform dir does not exist on create

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-10-26 10:55:50 +02:00 committed by GitHub
parent f9989728f7
commit ec424b260d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 158 additions and 322 deletions

View file

@ -46,7 +46,7 @@ type tfIAMClient interface {
type tfUpgradePlanner interface {
ShowPlan(ctx context.Context, logLevel terraform.LogLevel, output io.Writer) error
Plan(ctx context.Context, logLevel terraform.LogLevel) (bool, error)
PrepareUpgradeWorkspace(embeddedPath, backupDir string, vars terraform.Variables) error
PrepareWorkspace(path string, vars terraform.Variables) error
}
type tfIAMUpgradeClient interface {