mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
Enable GCP serial console for debug mode (#162)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
d0ba2eb6b7
commit
9c00f4efc2
@ -138,6 +138,7 @@ func (c *Creator) createGCP(ctx context.Context, cl gcpclient, config *config.Co
|
||||
}
|
||||
|
||||
createInput := gcpcl.CreateInstancesInput{
|
||||
EnableSerialConsole: config.IsDebugCluster(),
|
||||
CountControlPlanes: controlPlaneCount,
|
||||
CountWorkers: workerCount,
|
||||
ImageID: config.Provider.GCP.Image,
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -32,11 +33,14 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
|
||||
}
|
||||
ops := []Operation{}
|
||||
|
||||
enableSerialConsole := strconv.FormatBool(input.EnableSerialConsole)
|
||||
|
||||
workerTemplateInput := insertInstanceTemplateInput{
|
||||
Name: c.buildResourceName("worker"),
|
||||
Network: c.network,
|
||||
SecondarySubnetworkRangeName: c.secondarySubnetworkRange,
|
||||
Subnetwork: c.subnetwork,
|
||||
EnableSerialConsole: enableSerialConsole,
|
||||
ImageID: input.ImageID,
|
||||
InstanceType: input.InstanceType,
|
||||
StateDiskSizeGB: int64(input.StateDiskSizeGB),
|
||||
@ -60,6 +64,7 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
|
||||
Network: c.network,
|
||||
Subnetwork: c.subnetwork,
|
||||
SecondarySubnetworkRangeName: c.secondarySubnetworkRange,
|
||||
EnableSerialConsole: enableSerialConsole,
|
||||
ImageID: input.ImageID,
|
||||
InstanceType: input.InstanceType,
|
||||
StateDiskSizeGB: int64(input.StateDiskSizeGB),
|
||||
@ -317,6 +322,7 @@ func (i *instanceGroupManagerInput) InsertInstanceGroupManagerRequest() computep
|
||||
|
||||
// CreateInstancesInput is the input for a CreatInstances operation.
|
||||
type CreateInstancesInput struct {
|
||||
EnableSerialConsole bool
|
||||
CountWorkers int
|
||||
CountControlPlanes int
|
||||
ImageID string
|
||||
@ -331,6 +337,7 @@ type insertInstanceTemplateInput struct {
|
||||
Network string
|
||||
Subnetwork string
|
||||
SecondarySubnetworkRangeName string
|
||||
EnableSerialConsole string
|
||||
ImageID string
|
||||
InstanceType string
|
||||
StateDiskSizeGB int64
|
||||
@ -389,6 +396,10 @@ func (i insertInstanceTemplateInput) insertInstanceTemplateRequest() *computepb.
|
||||
Key: proto.String("constellation-role"),
|
||||
Value: proto.String(i.Role),
|
||||
},
|
||||
{
|
||||
Key: proto.String("serial-port-enable"),
|
||||
Value: proto.String(i.EnableSerialConsole),
|
||||
},
|
||||
},
|
||||
},
|
||||
NetworkInterfaces: []*computepb.NetworkInterface{
|
||||
|
Loading…
Reference in New Issue
Block a user