mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 22:34:56 -04:00
terraform: QEMU node groups (#1961)
* init add variables add amount to instance_group again fix tf validate rollback old names make fields optional fix image ref mini daniel comments use latest * Update cli/internal/terraform/terraform/qemu/main.tf Co-authored-by: Malte Poll <1780588+malt3@users.noreply.github.com> * add uid to resource name * make machine a global variable again * fix tf --------- Co-authored-by: Malte Poll <1780588+malt3@users.noreply.github.com>
This commit is contained in:
parent
161bb37cba
commit
9bb91ca447
11 changed files with 202 additions and 188 deletions
|
@ -19,6 +19,7 @@ import (
|
|||
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
||||
"github.com/edgelesssys/constellation/v2/internal/file"
|
||||
"github.com/edgelesssys/constellation/v2/internal/role"
|
||||
"github.com/hashicorp/terraform-exec/tfexec"
|
||||
tfjson "github.com/hashicorp/terraform-json"
|
||||
"github.com/spf13/afero"
|
||||
|
@ -33,17 +34,16 @@ func TestMain(m *testing.M) {
|
|||
|
||||
func TestPrepareCluster(t *testing.T) {
|
||||
qemuVars := &QEMUVariables{
|
||||
CommonVariables: CommonVariables{
|
||||
Name: "name",
|
||||
CountControlPlanes: 1,
|
||||
CountWorkers: 2,
|
||||
StateDiskSizeGB: 11,
|
||||
Name: "name",
|
||||
NodeGroups: map[string]QEMUNodeGroup{
|
||||
"control-plane": {
|
||||
Role: role.ControlPlane.TFString(),
|
||||
DiskSize: 30,
|
||||
CPUCount: 1,
|
||||
MemorySize: 1024,
|
||||
},
|
||||
},
|
||||
CPUCount: 1,
|
||||
MemorySizeMiB: 1024,
|
||||
ImagePath: "path",
|
||||
ImageFormat: "format",
|
||||
MetadataAPIImage: "api",
|
||||
Machine: "q35",
|
||||
}
|
||||
|
||||
testCases := map[string]struct {
|
||||
|
@ -248,14 +248,16 @@ func TestCreateCluster(t *testing.T) {
|
|||
return &workingState
|
||||
}
|
||||
qemuVars := &QEMUVariables{
|
||||
CommonVariables: CommonVariables{
|
||||
Name: "name",
|
||||
CountControlPlanes: 1,
|
||||
CountWorkers: 2,
|
||||
StateDiskSizeGB: 11,
|
||||
Name: "name",
|
||||
NodeGroups: map[string]QEMUNodeGroup{
|
||||
"control-plane": {
|
||||
Role: role.ControlPlane.TFString(),
|
||||
DiskSize: 11,
|
||||
CPUCount: 1,
|
||||
MemorySize: 1024,
|
||||
},
|
||||
},
|
||||
CPUCount: 1,
|
||||
MemorySizeMiB: 1024,
|
||||
Machine: "q35",
|
||||
ImagePath: "path",
|
||||
ImageFormat: "format",
|
||||
MetadataAPIImage: "api",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue