mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-07 16:55:15 -04:00
cli: store upgrade files in versioned folders (#1929)
* upgrade versioning * dont pass upgrade kind as boolean * whitespace * fix godot lint check * clarify upgrade check directory suffix * cli: dry-run Terraform migrations on `upgrade check` (#1942) * dry-run Terraform migrations on upgrade check * clean whole upgrade dir * clean up check workspace after planning * fix parsing * extend upgrade check test * rename unused parameters * exclude false positives in test
This commit is contained in:
parent
f3c2198a9a
commit
b25228d175
13 changed files with 300 additions and 127 deletions
|
@ -16,7 +16,6 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
||||
"github.com/edgelesssys/constellation/v2/internal/file"
|
||||
"github.com/spf13/afero"
|
||||
)
|
||||
|
@ -36,11 +35,11 @@ func prepareWorkspace(rootDir string, fileHandler file.Handler, workingDir strin
|
|||
|
||||
// prepareUpgradeWorkspace takes the Terraform state file from the old workspace and the
|
||||
// embedded Terraform files and writes them into the new workspace.
|
||||
func prepareUpgradeWorkspace(rootDir string, fileHandler file.Handler, oldWorkingDir, newWorkingDir string) error {
|
||||
func prepareUpgradeWorkspace(rootDir string, fileHandler file.Handler, oldWorkingDir, newWorkingDir, backupDir string) error {
|
||||
// backup old workspace
|
||||
if err := fileHandler.CopyDir(
|
||||
oldWorkingDir,
|
||||
filepath.Join(constants.UpgradeDir, constants.TerraformUpgradeBackupDir),
|
||||
backupDir,
|
||||
); err != nil {
|
||||
return fmt.Errorf("backing up old workspace: %w", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue