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
|
@ -44,8 +44,8 @@ type fakeAzureClient struct {
|
|||
func (c *fakeAzureClient) GetState() (state.ConstellationState, error) {
|
||||
stat := state.ConstellationState{
|
||||
CloudProvider: cloudprovider.Azure.String(),
|
||||
AzureWorkers: c.workers,
|
||||
AzureControlPlane: c.controlPlanes,
|
||||
AzureWorkerInstances: c.workers,
|
||||
AzureControlPlaneInstances: c.controlPlanes,
|
||||
Name: c.name,
|
||||
UID: c.uid,
|
||||
AzureResourceGroup: c.resourceGroup,
|
||||
|
@ -54,16 +54,16 @@ func (c *fakeAzureClient) GetState() (state.ConstellationState, error) {
|
|||
AzureTenant: c.tenantID,
|
||||
AzureSubnet: c.subnetID,
|
||||
AzureNetworkSecurityGroup: c.networkSecurityGroup,
|
||||
AzureWorkersScaleSet: c.workerScaleSet,
|
||||
AzureControlPlanesScaleSet: c.controlPlaneScaleSet,
|
||||
AzureWorkerScaleSet: c.workerScaleSet,
|
||||
AzureControlPlaneScaleSet: c.controlPlaneScaleSet,
|
||||
AzureADAppObjectID: c.adAppObjectID,
|
||||
}
|
||||
return stat, nil
|
||||
}
|
||||
|
||||
func (c *fakeAzureClient) SetState(stat state.ConstellationState) error {
|
||||
c.workers = stat.AzureWorkers
|
||||
c.controlPlanes = stat.AzureControlPlane
|
||||
c.workers = stat.AzureWorkerInstances
|
||||
c.controlPlanes = stat.AzureControlPlaneInstances
|
||||
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.workerScaleSet = stat.AzureWorkersScaleSet
|
||||
c.controlPlaneScaleSet = stat.AzureControlPlanesScaleSet
|
||||
c.workerScaleSet = stat.AzureWorkerScaleSet
|
||||
c.controlPlaneScaleSet = stat.AzureControlPlaneScaleSet
|
||||
c.adAppObjectID = stat.AzureADAppObjectID
|
||||
return nil
|
||||
}
|
||||
|
@ -260,8 +260,8 @@ type fakeGcpClient struct {
|
|||
func (c *fakeGcpClient) GetState() (state.ConstellationState, error) {
|
||||
stat := state.ConstellationState{
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPWorkers: c.workers,
|
||||
GCPControlPlanes: c.controlPlanes,
|
||||
GCPWorkerInstances: c.workers,
|
||||
GCPControlPlaneInstances: c.controlPlanes,
|
||||
GCPWorkerInstanceGroup: c.workerInstanceGroup,
|
||||
GCPControlPlaneInstanceGroup: c.controlPlaneInstanceGroup,
|
||||
GCPWorkerInstanceTemplate: c.workerTemplate,
|
||||
|
@ -282,8 +282,8 @@ func (c *fakeGcpClient) GetState() (state.ConstellationState, error) {
|
|||
}
|
||||
|
||||
func (c *fakeGcpClient) SetState(stat state.ConstellationState) error {
|
||||
c.workers = stat.GCPWorkers
|
||||
c.controlPlanes = stat.GCPControlPlanes
|
||||
c.workers = stat.GCPWorkerInstances
|
||||
c.controlPlanes = stat.GCPControlPlaneInstances
|
||||
c.workerInstanceGroup = stat.GCPWorkerInstanceGroup
|
||||
c.controlPlaneInstanceGroup = stat.GCPControlPlaneInstanceGroup
|
||||
c.workerTemplate = stat.GCPWorkerInstanceTemplate
|
||||
|
|
|
@ -17,11 +17,11 @@ func TestCreator(t *testing.T) {
|
|||
wantGCPState := state.ConstellationState{
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPProject: "project",
|
||||
GCPControlPlanes: cloudtypes.Instances{
|
||||
GCPControlPlaneInstances: 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"},
|
||||
},
|
||||
GCPWorkers: cloudtypes.Instances{
|
||||
GCPWorkerInstances: 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"},
|
||||
|
@ -44,20 +44,20 @@ func TestCreator(t *testing.T) {
|
|||
|
||||
wantAzureState := state.ConstellationState{
|
||||
CloudProvider: cloudprovider.Azure.String(),
|
||||
AzureControlPlane: cloudtypes.Instances{
|
||||
AzureControlPlaneInstances: 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"},
|
||||
},
|
||||
AzureWorkers: cloudtypes.Instances{
|
||||
AzureWorkerInstances: 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",
|
||||
AzureWorkersScaleSet: "workers-scale-set",
|
||||
AzureControlPlanesScaleSet: "controlplanes-scale-set",
|
||||
AzureResourceGroup: "resource-group",
|
||||
AzureSubnet: "subnet",
|
||||
AzureNetworkSecurityGroup: "network-security-group",
|
||||
AzureWorkerScaleSet: "workers-scale-set",
|
||||
AzureControlPlaneScaleSet: "controlplanes-scale-set",
|
||||
}
|
||||
|
||||
someErr := errors.New("failed")
|
||||
|
|
|
@ -17,8 +17,8 @@ func TestServiceAccountCreator(t *testing.T) {
|
|||
return state.ConstellationState{
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPProject: "project",
|
||||
GCPWorkers: cloudtypes.Instances{},
|
||||
GCPControlPlanes: cloudtypes.Instances{},
|
||||
GCPWorkerInstances: cloudtypes.Instances{},
|
||||
GCPControlPlaneInstances: cloudtypes.Instances{},
|
||||
GCPWorkerInstanceGroup: "workers-group",
|
||||
GCPControlPlaneInstanceGroup: "controlplane-group",
|
||||
GCPWorkerInstanceTemplate: "template",
|
||||
|
|
|
@ -16,11 +16,11 @@ func TestTerminator(t *testing.T) {
|
|||
return state.ConstellationState{
|
||||
CloudProvider: cloudprovider.GCP.String(),
|
||||
GCPProject: "project",
|
||||
GCPWorkers: cloudtypes.Instances{
|
||||
GCPWorkerInstances: 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"},
|
||||
},
|
||||
GCPControlPlanes: cloudtypes.Instances{
|
||||
GCPControlPlaneInstances: cloudtypes.Instances{
|
||||
"id-c": {PrivateIP: "192.0.2.1", PublicIP: "192.0.2.1"},
|
||||
},
|
||||
GCPWorkerInstanceGroup: "worker-group",
|
||||
|
@ -35,11 +35,11 @@ func TestTerminator(t *testing.T) {
|
|||
someAzureState := func() state.ConstellationState {
|
||||
return state.ConstellationState{
|
||||
CloudProvider: cloudprovider.Azure.String(),
|
||||
AzureWorkers: cloudtypes.Instances{
|
||||
AzureWorkerInstances: 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"},
|
||||
},
|
||||
AzureControlPlane: cloudtypes.Instances{
|
||||
AzureControlPlaneInstances: 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