Skip to content

Commit

Permalink
KIM Integration - preview plan on Azure (#999)
Browse files Browse the repository at this point in the history
* switch preview plan to Azure provider

* tests adjusted for preview provider change
  • Loading branch information
jaroslaw-pieszka authored Aug 7, 2024
1 parent eaf1789 commit 80d8b09
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (s *CreateRuntimeResourceStep) providerValues(operation *internal.Operation
ProvisioningParameters: operation.ProvisioningParameters,
}
case broker.PreviewPlanID:
p = &provider.AWSInputProvider{
p = &provider.AzureInputProvider{
MultiZone: s.config.MultiZoneCluster,
ProvisioningParameters: operation.ProvisioningParameters,
}
Expand Down
30 changes: 15 additions & 15 deletions internal/process/provisioning/create_runtime_resource_step_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func TestCreateRuntimeResourceStep_Defaults_Preview_SingleZone_ActualCreation(t

err := imv1.AddToScheme(scheme.Scheme)

instance, operation := fixInstanceAndOperation(broker.PreviewPlanID, "eu-west-2", "platform-region")
instance, operation := fixInstanceAndOperation(broker.PreviewPlanID, "westeurope", "platform-region")
assertInsertions(t, memoryStorage, instance, operation)

kimConfig := fixKimConfig("preview", false)
Expand Down Expand Up @@ -459,10 +459,10 @@ func TestCreateRuntimeResourceStep_Defaults_Preview_SingleZone_ActualCreation(t
assertLabelsKIMDriven(t, operation, runtime)
assertSecurity(t, runtime)

assert.Equal(t, "aws", runtime.Spec.Shoot.Provider.Type)
assert.Equal(t, "eu-west-2", runtime.Spec.Shoot.Region)
assert.Equal(t, "azure", runtime.Spec.Shoot.Provider.Type)
assert.Equal(t, "westeurope", runtime.Spec.Shoot.Region)
assert.Equal(t, "production", string(runtime.Spec.Shoot.Purpose))
assertWorkers(t, runtime.Spec.Shoot.Provider.Workers, "m6i.large", 20, 3, 1, 0, 1, []string{"eu-west-2a", "eu-west-2b", "eu-west-2c"})
assertWorkers(t, runtime.Spec.Shoot.Provider.Workers, "Standard_D2s_v5", 20, 3, 1, 0, 1, []string{"1", "2", "3"})

_, err = memoryStorage.Instances().GetByID(operation.InstanceID)
assert.NoError(t, err)
Expand All @@ -476,7 +476,7 @@ func TestCreateRuntimeResourceStep_Defaults_Preview_SingleZone_ActualCreation_Wi

err := imv1.AddToScheme(scheme.Scheme)

instance, operation := fixInstanceAndOperation(broker.PreviewPlanID, "eu-west-2", "platform-region")
instance, operation := fixInstanceAndOperation(broker.PreviewPlanID, "westeurope", "platform-region")
assertInsertions(t, memoryStorage, instance, operation)

kimConfig := fixKimConfig("preview", false)
Expand Down Expand Up @@ -505,10 +505,10 @@ func TestCreateRuntimeResourceStep_Defaults_Preview_SingleZone_ActualCreation_Wi
assertLabelsKIMDriven(t, operation, runtime)
assertSecurity(t, runtime)

assert.Equal(t, "aws", runtime.Spec.Shoot.Provider.Type)
assert.Equal(t, "eu-west-2", runtime.Spec.Shoot.Region)
assert.Equal(t, "azure", runtime.Spec.Shoot.Provider.Type)
assert.Equal(t, "westeurope", runtime.Spec.Shoot.Region)
assert.Equal(t, "production", string(runtime.Spec.Shoot.Purpose))
assertWorkers(t, runtime.Spec.Shoot.Provider.Workers, "m6i.large", 20, 3, 1, 0, 1, []string{"eu-west-2a", "eu-west-2b", "eu-west-2c"})
assertWorkers(t, runtime.Spec.Shoot.Provider.Workers, "Standard_D2s_v5", 20, 3, 1, 0, 1, []string{"1", "2", "3"})

// then retry
_, repeat, err = step.Run(operation, entry)
Expand All @@ -525,10 +525,10 @@ func TestCreateRuntimeResourceStep_Defaults_Preview_SingleZone_ActualCreation_Wi
assertLabelsKIMDriven(t, operation, runtime)
assertSecurity(t, runtime)

assert.Equal(t, "aws", runtime.Spec.Shoot.Provider.Type)
assert.Equal(t, "eu-west-2", runtime.Spec.Shoot.Region)
assert.Equal(t, "azure", runtime.Spec.Shoot.Provider.Type)
assert.Equal(t, "westeurope", runtime.Spec.Shoot.Region)
assert.Equal(t, "production", string(runtime.Spec.Shoot.Purpose))
assertWorkers(t, runtime.Spec.Shoot.Provider.Workers, "m6i.large", 20, 3, 1, 0, 1, []string{"eu-west-2a", "eu-west-2b", "eu-west-2c"})
assertWorkers(t, runtime.Spec.Shoot.Provider.Workers, "Standard_D2s_v5", 20, 3, 1, 0, 1, []string{"1", "2", "3"})

_, err = memoryStorage.Instances().GetByID(operation.InstanceID)
assert.NoError(t, err)
Expand All @@ -542,7 +542,7 @@ func TestCreateRuntimeResourceStep_Defaults_Preview_MultiZone_ActualCreation(t *

err := imv1.AddToScheme(scheme.Scheme)

instance, operation := fixInstanceAndOperation(broker.PreviewPlanID, "eu-west-2", "platform-region")
instance, operation := fixInstanceAndOperation(broker.PreviewPlanID, "westeurope", "platform-region")
assertInsertions(t, memoryStorage, instance, operation)

kimConfig := fixKimConfig("preview", false)
Expand Down Expand Up @@ -571,10 +571,10 @@ func TestCreateRuntimeResourceStep_Defaults_Preview_MultiZone_ActualCreation(t *
assertLabelsKIMDriven(t, operation, runtime)
assertSecurity(t, runtime)

assert.Equal(t, "aws", runtime.Spec.Shoot.Provider.Type)
assert.Equal(t, "eu-west-2", runtime.Spec.Shoot.Region)
assert.Equal(t, "azure", runtime.Spec.Shoot.Provider.Type)
assert.Equal(t, "westeurope", runtime.Spec.Shoot.Region)
assert.Equal(t, "production", string(runtime.Spec.Shoot.Purpose))
assertWorkers(t, runtime.Spec.Shoot.Provider.Workers, "m6i.large", 20, 3, 3, 0, 3, []string{"eu-west-2a", "eu-west-2b", "eu-west-2c"})
assertWorkers(t, runtime.Spec.Shoot.Provider.Workers, "Standard_D2s_v5", 20, 3, 3, 0, 3, []string{"1", "2", "3"})

_, err = memoryStorage.Instances().GetByID(operation.InstanceID)
assert.NoError(t, err)
Expand Down

0 comments on commit 80d8b09

Please sign in to comment.