Skip to content

Commit 3922c37

Browse files
Fix provider setting in the instance creation (#1958)
* Fix provider setting in the instance creation * wip * wip
1 parent b3f88b9 commit 3922c37

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

internal/broker/instance_create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ func (b *ProvisionEndpoint) Provision(ctx context.Context, instanceID string, de
250250
ServicePlanName: PlanNamesMapping[provisioningParameters.PlanID],
251251
DashboardURL: dashboardURL,
252252
Parameters: operation.ProvisioningParameters,
253+
Provider: pkg.CloudProviderFromString(providerValues.ProviderType),
253254
}
254255
err = b.instanceStorage.Insert(instance)
255256
if err != nil {

internal/broker/instance_create_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func TestProvision_Provision(t *testing.T) {
122122
assert.Regexp(t, `^https:\/\/dashboard\.example\.com\/\?kubeconfigID=`, response.DashboardURL)
123123
assert.Equal(t, instance.GlobalAccountID, globalAccountID)
124124
assert.Equal(t, fixDNSProviders(), instance.InstanceDetails.ShootDNSProviders)
125+
assert.Equal(t, pkg.Azure, instance.Provider)
125126
})
126127

127128
t.Run("new operation for own_cluster plan with kubeconfig will be created", func(t *testing.T) {

internal/runtime/converter.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ func (c *converter) ApplyProvisioningOperation(dto *pkg.RuntimeDTO, pOpr *intern
4444
c.applyOperation(&pOpr.Operation, dto.Status.Provisioning)
4545
c.adjustRuntimeState(dto)
4646
dto.SubscriptionSecretName = pOpr.ProvisioningParameters.Parameters.TargetSecret
47+
48+
// fallback if the field is not set, the provisioning operation contains it in the ProviderValues, see instance creation in the instance_create.go
49+
if dto.Provider == "" && pOpr.ProviderValues != nil {
50+
dto.Provider = string(pkg.CloudProviderFromString(pOpr.ProviderValues.ProviderType))
51+
}
4752
}
4853
}
4954

0 commit comments

Comments
 (0)