mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-28 01:35:18 -04:00
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:
parent
f9989728f7
commit
ec424b260d
15 changed files with 158 additions and 322 deletions
|
@ -24,12 +24,12 @@ import (
|
|||
|
||||
func TestPlanClusterUpgrade(t *testing.T) {
|
||||
setUpFilesystem := func(existingFiles []string) file.Handler {
|
||||
fs := afero.NewMemMapFs()
|
||||
fs := file.NewHandler(afero.NewMemMapFs())
|
||||
require.NoError(t, fs.MkdirAll("test"))
|
||||
for _, f := range existingFiles {
|
||||
require.NoError(t, afero.WriteFile(fs, f, []byte{}, 0o644))
|
||||
require.NoError(t, fs.Write(f, []byte{}))
|
||||
}
|
||||
|
||||
return file.NewHandler(fs)
|
||||
return fs
|
||||
}
|
||||
|
||||
testCases := map[string]struct {
|
||||
|
@ -199,6 +199,6 @@ func (t *tfClusterUpgradeStub) ApplyCluster(_ context.Context, _ cloudprovider.P
|
|||
return state.Infrastructure{}, t.applyErr
|
||||
}
|
||||
|
||||
func (t *tfClusterUpgradeStub) PrepareUpgradeWorkspace(_, _ string, _ terraform.Variables) error {
|
||||
func (t *tfClusterUpgradeStub) PrepareWorkspace(_ string, _ terraform.Variables) error {
|
||||
return t.prepareWorkspaceErr
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue