mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-30 02:28:48 -04:00
Add qemu cloudprovider for activation calls
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
f2305b3ce6
commit
8444d5c515
10 changed files with 237 additions and 0 deletions
|
@ -384,6 +384,8 @@ func getScalingGroupsFromConfig(stat state.ConstellationState, config *config.Co
|
|||
return getGCPInstances(stat, config)
|
||||
case len(stat.AzureCoordinators) != 0:
|
||||
return getAzureInstances(stat, config)
|
||||
case len(stat.QEMUCoordinators) != 0:
|
||||
return getQEMUInstances(stat, config)
|
||||
default:
|
||||
return ScalingGroup{}, ScalingGroup{}, errors.New("no instances to init")
|
||||
}
|
||||
|
@ -488,6 +490,38 @@ func getAzureInstances(stat state.ConstellationState, config *config.Config) (co
|
|||
return
|
||||
}
|
||||
|
||||
func getQEMUInstances(stat state.ConstellationState, config *config.Config) (coordinators, nodes ScalingGroup, err error) {
|
||||
coordinatorMap := stat.QEMUCoordinators
|
||||
if len(coordinatorMap) == 0 {
|
||||
return ScalingGroup{}, ScalingGroup{}, errors.New("no coordinators available, can't create Constellation without any instance")
|
||||
}
|
||||
var coordinatorInstances Instances
|
||||
for _, node := range coordinatorMap {
|
||||
coordinatorInstances = append(coordinatorInstances, Instance(node))
|
||||
}
|
||||
// QEMU does not support autoscaling
|
||||
coordinators = ScalingGroup{
|
||||
Instances: coordinatorInstances,
|
||||
GroupID: "",
|
||||
}
|
||||
nodeMap := stat.QEMUNodes
|
||||
if len(nodeMap) == 0 {
|
||||
return ScalingGroup{}, ScalingGroup{}, errors.New("no nodes available, can't create Constellation with one instance")
|
||||
}
|
||||
|
||||
var nodeInstances Instances
|
||||
for _, node := range nodeMap {
|
||||
nodeInstances = append(nodeInstances, Instance(node))
|
||||
}
|
||||
|
||||
// QEMU does not support autoscaling
|
||||
nodes = ScalingGroup{
|
||||
Instances: nodeInstances,
|
||||
GroupID: "",
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// initCompletion handels the completion of CLI arguments. It is frequently called
|
||||
// while the user types arguments of the command to suggest completion.
|
||||
func initCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue