mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
Rename coordinator to bootstrapper and rename roles
This commit is contained in:
parent
3280ed200c
commit
916e5d6b55
191 changed files with 1763 additions and 2030 deletions
|
@ -24,8 +24,8 @@ func TestMain(m *testing.M) {
|
|||
}
|
||||
|
||||
type fakeAzureClient struct {
|
||||
nodes cloudtypes.Instances
|
||||
coordinators cloudtypes.Instances
|
||||
workers cloudtypes.Instances
|
||||
controlPlanes cloudtypes.Instances
|
||||
|
||||
resourceGroup string
|
||||
name string
|
||||
|
@ -35,35 +35,35 @@ type fakeAzureClient struct {
|
|||
tenantID string
|
||||
subnetID string
|
||||
loadBalancerName string
|
||||
coordinatorsScaleSet string
|
||||
nodesScaleSet string
|
||||
controlPlaneScaleSet string
|
||||
workerScaleSet string
|
||||
networkSecurityGroup string
|
||||
adAppObjectID string
|
||||
}
|
||||
|
||||
func (c *fakeAzureClient) GetState() (state.ConstellationState, error) {
|
||||
stat := state.ConstellationState{
|
||||
CloudProvider: cloudprovider.Azure.String(),
|
||||
AzureNodes: c.nodes,
|
||||
AzureCoordinators: c.coordinators,
|
||||
Name: c.name,
|
||||
UID: c.uid,
|
||||
AzureResourceGroup: c.resourceGroup,
|
||||
AzureLocation: c.location,
|
||||
AzureSubscription: c.subscriptionID,
|
||||
AzureTenant: c.tenantID,
|
||||
AzureSubnet: c.subnetID,
|
||||
AzureNetworkSecurityGroup: c.networkSecurityGroup,
|
||||
AzureNodesScaleSet: c.nodesScaleSet,
|
||||
AzureCoordinatorsScaleSet: c.coordinatorsScaleSet,
|
||||
AzureADAppObjectID: c.adAppObjectID,
|
||||
CloudProvider: cloudprovider.Azure.String(),
|
||||
AzureWorkers: c.workers,
|
||||
AzureControlPlane: c.controlPlanes,
|
||||
Name: c.name,
|
||||
UID: c.uid,
|
||||
AzureResourceGroup: c.resourceGroup,
|
||||
AzureLocation: c.location,
|
||||
AzureSubscription: c.subscriptionID,
|
||||
AzureTenant: c.tenantID,
|
||||
AzureSubnet: c.subnetID,
|
||||
AzureNetworkSecurityGroup: c.networkSecurityGroup,
|
||||
AzureWorkersScaleSet: c.workerScaleSet,
|
||||
AzureControlPlanesScaleSet: c.controlPlaneScaleSet,
|
||||
AzureADAppObjectID: c.adAppObjectID,
|
||||
}
|
||||
return stat, nil
|
||||
}
|
||||
|
||||
func (c *fakeAzureClient) SetState(stat state.ConstellationState) error {
|
||||
c.nodes = stat.AzureNodes
|
||||
c.coordinators = stat.AzureCoordinators
|
||||
c.workers = stat.AzureWorkers
|
||||
c.controlPlanes = stat.AzureControlPlane
|
||||
c.name = stat.Name
|
||||
c.uid = stat.UID
|
||||
c.resourceGroup = stat.AzureResourceGroup
|
||||
|
@ -72,8 +72,8 @@ func (c *fakeAzureClient) SetState(stat state.ConstellationState) error {
|
|||
c.tenantID = stat.AzureTenant
|
||||
c.subnetID = stat.AzureSubnet
|
||||
c.networkSecurityGroup = stat.AzureNetworkSecurityGroup
|
||||
c.nodesScaleSet = stat.AzureNodesScaleSet
|
||||
c.coordinatorsScaleSet = stat.AzureCoordinatorsScaleSet
|
||||
c.workerScaleSet = stat.AzureWorkersScaleSet
|
||||
c.controlPlaneScaleSet = stat.AzureControlPlanesScaleSet
|
||||
c.adAppObjectID = stat.AzureADAppObjectID
|
||||
return nil
|
||||
}
|
||||
|
@ -103,32 +103,32 @@ func (c *fakeAzureClient) CreateSecurityGroup(ctx context.Context, input azurecl
|
|||
}
|
||||
|
||||
func (c *fakeAzureClient) CreateInstances(ctx context.Context, input azurecl.CreateInstancesInput) error {
|
||||
c.coordinatorsScaleSet = "coordinators-scale-set"
|
||||
c.nodesScaleSet = "nodes-scale-set"
|
||||
c.nodes = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountNodes; i++ {
|
||||
c.controlPlaneScaleSet = "controlplanes-scale-set"
|
||||
c.workerScaleSet = "workers-scale-set"
|
||||
c.workers = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountWorkers; i++ {
|
||||
id := "id-" + strconv.Itoa(i)
|
||||
c.nodes[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
c.workers[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
}
|
||||
c.coordinators = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountCoordinators; i++ {
|
||||
c.controlPlanes = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountControlPlanes; i++ {
|
||||
id := "id-" + strconv.Itoa(i)
|
||||
c.coordinators[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
c.controlPlanes[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO: deprecate as soon as scale sets are available.
|
||||
func (c *fakeAzureClient) CreateInstancesVMs(ctx context.Context, input azurecl.CreateInstancesInput) error {
|
||||
c.nodes = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountNodes; i++ {
|
||||
c.workers = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountWorkers; i++ {
|
||||
id := "id-" + strconv.Itoa(i)
|
||||
c.nodes[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
c.workers[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
}
|
||||
c.coordinators = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountCoordinators; i++ {
|
||||
c.controlPlanes = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountControlPlanes; i++ {
|
||||
id := "id-" + strconv.Itoa(i)
|
||||
c.coordinators[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
c.controlPlanes[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -145,13 +145,13 @@ func (c *fakeAzureClient) TerminateResourceGroup(ctx context.Context) error {
|
|||
if c.resourceGroup == "" {
|
||||
return nil
|
||||
}
|
||||
c.nodes = nil
|
||||
c.coordinators = nil
|
||||
c.workers = nil
|
||||
c.controlPlanes = nil
|
||||
c.resourceGroup = ""
|
||||
c.subnetID = ""
|
||||
c.networkSecurityGroup = ""
|
||||
c.nodesScaleSet = ""
|
||||
c.coordinatorsScaleSet = ""
|
||||
c.workerScaleSet = ""
|
||||
c.controlPlaneScaleSet = ""
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -235,21 +235,21 @@ func (c *stubAzureClient) TerminateServicePrincipal(ctx context.Context) error {
|
|||
}
|
||||
|
||||
type fakeGcpClient struct {
|
||||
nodes cloudtypes.Instances
|
||||
coordinators cloudtypes.Instances
|
||||
workers cloudtypes.Instances
|
||||
controlPlanes cloudtypes.Instances
|
||||
|
||||
nodesInstanceGroup string
|
||||
coordinatorInstanceGroup string
|
||||
coordinatorTemplate string
|
||||
nodeTemplate string
|
||||
network string
|
||||
subnetwork string
|
||||
firewalls []string
|
||||
project string
|
||||
uid string
|
||||
name string
|
||||
zone string
|
||||
serviceAccount string
|
||||
workerInstanceGroup string
|
||||
controlPlaneInstanceGroup string
|
||||
controlPlaneTemplate string
|
||||
workerTemplate string
|
||||
network string
|
||||
subnetwork string
|
||||
firewalls []string
|
||||
project string
|
||||
uid string
|
||||
name string
|
||||
zone string
|
||||
serviceAccount string
|
||||
|
||||
// loadbalancer
|
||||
healthCheck string
|
||||
|
@ -259,35 +259,35 @@ type fakeGcpClient struct {
|
|||
|
||||
func (c *fakeGcpClient) GetState() (state.ConstellationState, error) {
|
||||
stat := state.ConstellationState{
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPNodes: c.nodes,
|
||||
GCPCoordinators: c.coordinators,
|
||||
GCPNodeInstanceGroup: c.nodesInstanceGroup,
|
||||
GCPCoordinatorInstanceGroup: c.coordinatorInstanceGroup,
|
||||
GCPNodeInstanceTemplate: c.nodeTemplate,
|
||||
GCPCoordinatorInstanceTemplate: c.coordinatorTemplate,
|
||||
GCPNetwork: c.network,
|
||||
GCPSubnetwork: c.subnetwork,
|
||||
GCPFirewalls: c.firewalls,
|
||||
GCPBackendService: c.backendService,
|
||||
GCPHealthCheck: c.healthCheck,
|
||||
GCPForwardingRule: c.forwardingRule,
|
||||
GCPProject: c.project,
|
||||
Name: c.name,
|
||||
UID: c.uid,
|
||||
GCPZone: c.zone,
|
||||
GCPServiceAccount: c.serviceAccount,
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPWorkers: c.workers,
|
||||
GCPControlPlanes: c.controlPlanes,
|
||||
GCPWorkerInstanceGroup: c.workerInstanceGroup,
|
||||
GCPControlPlaneInstanceGroup: c.controlPlaneInstanceGroup,
|
||||
GCPWorkerInstanceTemplate: c.workerTemplate,
|
||||
GCPControlPlaneInstanceTemplate: c.controlPlaneTemplate,
|
||||
GCPNetwork: c.network,
|
||||
GCPSubnetwork: c.subnetwork,
|
||||
GCPFirewalls: c.firewalls,
|
||||
GCPBackendService: c.backendService,
|
||||
GCPHealthCheck: c.healthCheck,
|
||||
GCPForwardingRule: c.forwardingRule,
|
||||
GCPProject: c.project,
|
||||
Name: c.name,
|
||||
UID: c.uid,
|
||||
GCPZone: c.zone,
|
||||
GCPServiceAccount: c.serviceAccount,
|
||||
}
|
||||
return stat, nil
|
||||
}
|
||||
|
||||
func (c *fakeGcpClient) SetState(stat state.ConstellationState) error {
|
||||
c.nodes = stat.GCPNodes
|
||||
c.coordinators = stat.GCPCoordinators
|
||||
c.nodesInstanceGroup = stat.GCPNodeInstanceGroup
|
||||
c.coordinatorInstanceGroup = stat.GCPCoordinatorInstanceGroup
|
||||
c.nodeTemplate = stat.GCPNodeInstanceTemplate
|
||||
c.coordinatorTemplate = stat.GCPCoordinatorInstanceTemplate
|
||||
c.workers = stat.GCPWorkers
|
||||
c.controlPlanes = stat.GCPControlPlanes
|
||||
c.workerInstanceGroup = stat.GCPWorkerInstanceGroup
|
||||
c.controlPlaneInstanceGroup = stat.GCPControlPlaneInstanceGroup
|
||||
c.workerTemplate = stat.GCPWorkerInstanceTemplate
|
||||
c.controlPlaneTemplate = stat.GCPControlPlaneInstanceTemplate
|
||||
c.network = stat.GCPNetwork
|
||||
c.subnetwork = stat.GCPSubnetwork
|
||||
c.firewalls = stat.GCPFirewalls
|
||||
|
@ -319,19 +319,19 @@ func (c *fakeGcpClient) CreateFirewall(ctx context.Context, input gcpcl.Firewall
|
|||
}
|
||||
|
||||
func (c *fakeGcpClient) CreateInstances(ctx context.Context, input gcpcl.CreateInstancesInput) error {
|
||||
c.coordinatorInstanceGroup = "coordinator-group"
|
||||
c.nodesInstanceGroup = "nodes-group"
|
||||
c.nodeTemplate = "node-template"
|
||||
c.coordinatorTemplate = "coordinator-template"
|
||||
c.nodes = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountNodes; i++ {
|
||||
c.controlPlaneInstanceGroup = "controlplane-group"
|
||||
c.workerInstanceGroup = "workers-group"
|
||||
c.workerTemplate = "worker-template"
|
||||
c.controlPlaneTemplate = "controlplane-template"
|
||||
c.workers = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountWorkers; i++ {
|
||||
id := "id-" + strconv.Itoa(i)
|
||||
c.nodes[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
c.workers[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
}
|
||||
c.coordinators = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountCoordinators; i++ {
|
||||
c.controlPlanes = make(cloudtypes.Instances)
|
||||
for i := 0; i < input.CountControlPlanes; i++ {
|
||||
id := "id-" + strconv.Itoa(i)
|
||||
c.coordinators[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
c.controlPlanes[id] = cloudtypes.Instance{PublicIP: "192.0.2.1", PrivateIP: "192.0.2.1"}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -377,12 +377,12 @@ func (c *fakeGcpClient) TerminateVPCs(context.Context) error {
|
|||
}
|
||||
|
||||
func (c *fakeGcpClient) TerminateInstances(context.Context) error {
|
||||
c.nodeTemplate = ""
|
||||
c.coordinatorTemplate = ""
|
||||
c.nodesInstanceGroup = ""
|
||||
c.coordinatorInstanceGroup = ""
|
||||
c.nodes = nil
|
||||
c.coordinators = nil
|
||||
c.workerTemplate = ""
|
||||
c.controlPlaneTemplate = ""
|
||||
c.workerInstanceGroup = ""
|
||||
c.controlPlaneInstanceGroup = ""
|
||||
c.workers = nil
|
||||
c.controlPlanes = nil
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ func NewCreator(out io.Writer) *Creator {
|
|||
}
|
||||
|
||||
// Create creates the handed amount of instances and all the needed resources.
|
||||
func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, config *config.Config, name, insType string, coordCount, nodeCount int,
|
||||
func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, config *config.Config, name, insType string, controlPlaneCount, workerCount int,
|
||||
) (state.ConstellationState, error) {
|
||||
switch provider {
|
||||
case cloudprovider.GCP:
|
||||
|
@ -50,7 +50,7 @@ func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, c
|
|||
return state.ConstellationState{}, err
|
||||
}
|
||||
defer cl.Close()
|
||||
return c.createGCP(ctx, cl, config, insType, coordCount, nodeCount)
|
||||
return c.createGCP(ctx, cl, config, insType, controlPlaneCount, workerCount)
|
||||
case cloudprovider.Azure:
|
||||
cl, err := c.newAzureClient(
|
||||
config.Provider.Azure.SubscriptionID,
|
||||
|
@ -61,13 +61,13 @@ func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, c
|
|||
if err != nil {
|
||||
return state.ConstellationState{}, err
|
||||
}
|
||||
return c.createAzure(ctx, cl, config, insType, coordCount, nodeCount)
|
||||
return c.createAzure(ctx, cl, config, insType, controlPlaneCount, workerCount)
|
||||
default:
|
||||
return state.ConstellationState{}, fmt.Errorf("unsupported cloud provider: %s", provider)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Creator) createGCP(ctx context.Context, cl gcpclient, config *config.Config, insType string, coordCount, nodeCount int,
|
||||
func (c *Creator) createGCP(ctx context.Context, cl gcpclient, config *config.Config, insType string, controlPlaneCount, workerCount int,
|
||||
) (stat state.ConstellationState, retErr error) {
|
||||
defer rollbackOnError(context.Background(), c.out, &retErr, &rollbackerGCP{client: cl})
|
||||
|
||||
|
@ -121,12 +121,12 @@ func (c *Creator) createGCP(ctx context.Context, cl gcpclient, config *config.Co
|
|||
}
|
||||
|
||||
createInput := gcpcl.CreateInstancesInput{
|
||||
CountCoordinators: coordCount,
|
||||
CountNodes: nodeCount,
|
||||
ImageId: config.Provider.GCP.Image,
|
||||
InstanceType: insType,
|
||||
StateDiskSizeGB: config.StateDiskSizeGB,
|
||||
KubeEnv: gcp.KubeEnv,
|
||||
CountControlPlanes: controlPlaneCount,
|
||||
CountWorkers: workerCount,
|
||||
ImageId: config.Provider.GCP.Image,
|
||||
InstanceType: insType,
|
||||
StateDiskSizeGB: config.StateDiskSizeGB,
|
||||
KubeEnv: gcp.KubeEnv,
|
||||
}
|
||||
if err := cl.CreateInstances(ctx, createInput); err != nil {
|
||||
return state.ConstellationState{}, err
|
||||
|
@ -139,7 +139,7 @@ func (c *Creator) createGCP(ctx context.Context, cl gcpclient, config *config.Co
|
|||
return cl.GetState()
|
||||
}
|
||||
|
||||
func (c *Creator) createAzure(ctx context.Context, cl azureclient, config *config.Config, insType string, coordCount, nodeCount int,
|
||||
func (c *Creator) createAzure(ctx context.Context, cl azureclient, config *config.Config, insType string, controlPlaneCount, workerCount int,
|
||||
) (stat state.ConstellationState, retErr error) {
|
||||
defer rollbackOnError(context.Background(), c.out, &retErr, &rollbackerAzure{client: cl})
|
||||
|
||||
|
@ -163,8 +163,8 @@ func (c *Creator) createAzure(ctx context.Context, cl azureclient, config *confi
|
|||
return state.ConstellationState{}, err
|
||||
}
|
||||
createInput := azurecl.CreateInstancesInput{
|
||||
CountCoordinators: coordCount,
|
||||
CountNodes: nodeCount,
|
||||
CountControlPlanes: controlPlaneCount,
|
||||
CountWorkers: workerCount,
|
||||
InstanceType: insType,
|
||||
StateDiskSizeGB: config.StateDiskSizeGB,
|
||||
Image: config.Provider.Azure.Image,
|
||||
|
|
|
@ -17,26 +17,26 @@ func TestCreator(t *testing.T) {
|
|||
wantGCPState := state.ConstellationState{
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPProject: "project",
|
||||
GCPCoordinators: cloudtypes.Instances{
|
||||
GCPControlPlanes: cloudtypes.Instances{
|
||||
"id-0": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
"id-1": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
},
|
||||
GCPNodes: cloudtypes.Instances{
|
||||
GCPWorkers: cloudtypes.Instances{
|
||||
"id-0": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
"id-1": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
"id-2": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
},
|
||||
GCPNodeInstanceGroup: "nodes-group",
|
||||
GCPCoordinatorInstanceGroup: "coordinator-group",
|
||||
GCPNodeInstanceTemplate: "node-template",
|
||||
GCPCoordinatorInstanceTemplate: "coordinator-template",
|
||||
GCPNetwork: "network",
|
||||
GCPSubnetwork: "subnetwork",
|
||||
GCPBackendService: "backend-service",
|
||||
GCPHealthCheck: "health-check",
|
||||
GCPForwardingRule: "forwarding-rule",
|
||||
GCPWorkerInstanceGroup: "workers-group",
|
||||
GCPControlPlaneInstanceGroup: "controlplane-group",
|
||||
GCPWorkerInstanceTemplate: "worker-template",
|
||||
GCPControlPlaneInstanceTemplate: "controlplane-template",
|
||||
GCPNetwork: "network",
|
||||
GCPSubnetwork: "subnetwork",
|
||||
GCPBackendService: "backend-service",
|
||||
GCPHealthCheck: "health-check",
|
||||
GCPForwardingRule: "forwarding-rule",
|
||||
GCPFirewalls: []string{
|
||||
"coordinator", "wireguard", "ssh", "nodeport", "kubernetes",
|
||||
"controlplane", "wireguard", "ssh", "nodeport", "kubernetes",
|
||||
"allow-cluster-internal-tcp", "allow-cluster-internal-udp", "allow-cluster-internal-icmp",
|
||||
"allow-node-internal-tcp", "allow-node-internal-udp", "allow-node-internal-icmp",
|
||||
},
|
||||
|
@ -44,20 +44,20 @@ func TestCreator(t *testing.T) {
|
|||
|
||||
wantAzureState := state.ConstellationState{
|
||||
CloudProvider: cloudprovider.Azure.String(),
|
||||
AzureCoordinators: cloudtypes.Instances{
|
||||
AzureControlPlane: cloudtypes.Instances{
|
||||
"id-0": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
"id-1": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
},
|
||||
AzureNodes: cloudtypes.Instances{
|
||||
AzureWorkers: cloudtypes.Instances{
|
||||
"id-0": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
"id-1": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
"id-2": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
},
|
||||
AzureResourceGroup: "resource-group",
|
||||
AzureSubnet: "subnet",
|
||||
AzureNetworkSecurityGroup: "network-security-group",
|
||||
AzureNodesScaleSet: "nodes-scale-set",
|
||||
AzureCoordinatorsScaleSet: "coordinators-scale-set",
|
||||
AzureResourceGroup: "resource-group",
|
||||
AzureSubnet: "subnet",
|
||||
AzureNetworkSecurityGroup: "network-security-group",
|
||||
AzureWorkersScaleSet: "workers-scale-set",
|
||||
AzureControlPlanesScaleSet: "controlplanes-scale-set",
|
||||
}
|
||||
|
||||
someErr := errors.New("failed")
|
||||
|
|
|
@ -15,16 +15,16 @@ import (
|
|||
func TestServiceAccountCreator(t *testing.T) {
|
||||
someGCPState := func() state.ConstellationState {
|
||||
return state.ConstellationState{
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPProject: "project",
|
||||
GCPNodes: cloudtypes.Instances{},
|
||||
GCPCoordinators: cloudtypes.Instances{},
|
||||
GCPNodeInstanceGroup: "nodes-group",
|
||||
GCPCoordinatorInstanceGroup: "coord-group",
|
||||
GCPNodeInstanceTemplate: "template",
|
||||
GCPCoordinatorInstanceTemplate: "template",
|
||||
GCPNetwork: "network",
|
||||
GCPFirewalls: []string{},
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPProject: "project",
|
||||
GCPWorkers: cloudtypes.Instances{},
|
||||
GCPControlPlanes: cloudtypes.Instances{},
|
||||
GCPWorkerInstanceGroup: "workers-group",
|
||||
GCPControlPlaneInstanceGroup: "controlplane-group",
|
||||
GCPWorkerInstanceTemplate: "template",
|
||||
GCPControlPlaneInstanceTemplate: "template",
|
||||
GCPNetwork: "network",
|
||||
GCPFirewalls: []string{},
|
||||
}
|
||||
}
|
||||
someAzureState := func() state.ConstellationState {
|
||||
|
|
|
@ -16,30 +16,30 @@ func TestTerminator(t *testing.T) {
|
|||
return state.ConstellationState{
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPProject: "project",
|
||||
GCPNodes: cloudtypes.Instances{
|
||||
GCPWorkers: cloudtypes.Instances{
|
||||
"id-0": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
"id-1": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
},
|
||||
GCPCoordinators: cloudtypes.Instances{
|
||||
GCPControlPlanes: cloudtypes.Instances{
|
||||
"id-c": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
},
|
||||
GCPNodeInstanceGroup: "nodes-group",
|
||||
GCPCoordinatorInstanceGroup: "coord-group",
|
||||
GCPNodeInstanceTemplate: "template",
|
||||
GCPCoordinatorInstanceTemplate: "template",
|
||||
GCPNetwork: "network",
|
||||
GCPFirewalls: []string{"a", "b", "c"},
|
||||
GCPServiceAccount: "service-account@project.iam.gserviceaccount.com",
|
||||
GCPWorkerInstanceGroup: "worker-group",
|
||||
GCPControlPlaneInstanceGroup: "controlplane-group",
|
||||
GCPWorkerInstanceTemplate: "template",
|
||||
GCPControlPlaneInstanceTemplate: "template",
|
||||
GCPNetwork: "network",
|
||||
GCPFirewalls: []string{"a", "b", "c"},
|
||||
GCPServiceAccount: "service-account@project.iam.gserviceaccount.com",
|
||||
}
|
||||
}
|
||||
someAzureState := func() state.ConstellationState {
|
||||
return state.ConstellationState{
|
||||
CloudProvider: cloudprovider.Azure.String(),
|
||||
AzureNodes: cloudtypes.Instances{
|
||||
AzureWorkers: cloudtypes.Instances{
|
||||
"id-0": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
"id-1": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
},
|
||||
AzureCoordinators: cloudtypes.Instances{
|
||||
AzureControlPlane: cloudtypes.Instances{
|
||||
"id-c": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
},
|
||||
AzureResourceGroup: "group",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue