mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-08 15:02:18 -04:00
Fix naming in state file
This commit is contained in:
parent
779a73a03d
commit
c2faa20d6e
13 changed files with 533 additions and 533 deletions
|
@ -13,11 +13,11 @@ import (
|
|||
|
||||
func GetScalingGroupsFromConfig(stat state.ConstellationState, config *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) {
|
||||
switch {
|
||||
case len(stat.GCPControlPlanes) != 0:
|
||||
case len(stat.GCPControlPlaneInstances) != 0:
|
||||
return getGCPInstances(stat, config)
|
||||
case len(stat.AzureControlPlane) != 0:
|
||||
case len(stat.AzureControlPlaneInstances) != 0:
|
||||
return getAzureInstances(stat, config)
|
||||
case len(stat.QEMUControlPlane) != 0:
|
||||
case len(stat.QEMUControlPlaneInstances) != 0:
|
||||
return getQEMUInstances(stat, config)
|
||||
default:
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no instances to init")
|
||||
|
@ -25,54 +25,54 @@ func GetScalingGroupsFromConfig(stat state.ConstellationState, config *config.Co
|
|||
}
|
||||
|
||||
func getGCPInstances(stat state.ConstellationState, _ *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) {
|
||||
if len(stat.GCPControlPlanes) == 0 {
|
||||
if len(stat.GCPControlPlaneInstances) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no control-plane workers available, can't create Constellation without any instance")
|
||||
}
|
||||
|
||||
// GroupID of controlPlanes is empty, since they currently do not scale.
|
||||
controlPlanes = cloudtypes.ScalingGroup{Instances: stat.GCPControlPlanes}
|
||||
controlPlanes = cloudtypes.ScalingGroup{Instances: stat.GCPControlPlaneInstances}
|
||||
|
||||
if len(stat.GCPWorkers) == 0 {
|
||||
if len(stat.GCPWorkerInstances) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no worker workers available, can't create Constellation with one instance")
|
||||
}
|
||||
|
||||
// TODO: make min / max configurable and abstract autoscaling for different cloud providers
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.GCPWorkers}
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.GCPWorkerInstances}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func getAzureInstances(stat state.ConstellationState, _ *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) {
|
||||
if len(stat.AzureControlPlane) == 0 {
|
||||
if len(stat.AzureControlPlaneInstances) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no control-plane workers available, can't create Constellation cluster without any instance")
|
||||
}
|
||||
|
||||
// GroupID of controlPlanes is empty, since they currently do not scale.
|
||||
controlPlanes = cloudtypes.ScalingGroup{Instances: stat.AzureControlPlane}
|
||||
controlPlanes = cloudtypes.ScalingGroup{Instances: stat.AzureControlPlaneInstances}
|
||||
|
||||
if len(stat.AzureWorkers) == 0 {
|
||||
if len(stat.AzureWorkerInstances) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no worker workers available, can't create Constellation cluster with one instance")
|
||||
}
|
||||
|
||||
// TODO: make min / max configurable and abstract autoscaling for different cloud providers
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.AzureWorkers}
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.AzureWorkerInstances}
|
||||
return
|
||||
}
|
||||
|
||||
func getQEMUInstances(stat state.ConstellationState, _ *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) {
|
||||
controlPlaneMap := stat.QEMUControlPlane
|
||||
controlPlaneMap := stat.QEMUControlPlaneInstances
|
||||
if len(controlPlaneMap) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no controlPlanes available, can't create Constellation without any instance")
|
||||
}
|
||||
|
||||
// QEMU does not support autoscaling
|
||||
controlPlanes = cloudtypes.ScalingGroup{Instances: stat.QEMUControlPlane}
|
||||
controlPlanes = cloudtypes.ScalingGroup{Instances: stat.QEMUControlPlaneInstances}
|
||||
|
||||
if len(stat.QEMUWorkers) == 0 {
|
||||
if len(stat.QEMUWorkerInstances) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no workers available, can't create Constellation with one instance")
|
||||
}
|
||||
|
||||
// QEMU does not support autoscaling
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.QEMUWorkers}
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.QEMUWorkerInstances}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue