diff --git a/cmd/broker/main.go b/cmd/broker/main.go index 51e5fbf278..fcd525faec 100644 --- a/cmd/broker/main.go +++ b/cmd/broker/main.go @@ -482,16 +482,10 @@ func createAPI(router *mux.Router, servicesConfig broker.ServicesConfig, planVal fatalOnError(err, logs) logs.Infof("Number of globalAccountIds for unlimited freeemium: %d\n", len(freemiumGlobalAccountIds)) - var convergedCloudRegionProvider = broker.NewOneForAllConvergedCloudRegionsProvider() - // backward compatibility for tests - if cfg.SapConvergedCloudRegionMappingsFilePath != "" { - convergedCloudRegionProvider, err = broker.NewDefaultConvergedCloudRegionsProvider(cfg.SapConvergedCloudRegionMappingsFilePath, &broker.YamlRegionReader{}) - fatalOnError(err, logs) - logs.Infof("%s plan region mappings loaded", broker.SapConvergedCloudPlanName) - } else { - logs.Warnf("%s plan region mappings file path is not set, using old configuration", broker.SapConvergedCloudPlanName) - } + convergedCloudRegionProvider, err := broker.NewDefaultConvergedCloudRegionsProvider(cfg.SapConvergedCloudRegionMappingsFilePath, &broker.YamlRegionReader{}) + fatalOnError(err, logs) + logs.Infof("%s plan region mappings loaded", broker.SapConvergedCloudPlanName) // create KymaEnvironmentBroker endpoints kymaEnvBroker := &broker.KymaEnvironmentBroker{ diff --git a/cmd/broker/provisioning_test.go b/cmd/broker/provisioning_test.go index ed7489ea66..79f53a2e1e 100644 --- a/cmd/broker/provisioning_test.go +++ b/cmd/broker/provisioning_test.go @@ -199,7 +199,7 @@ func TestProvisioning_HappyPathSapConvergedCloud(t *testing.T) { iid := uuid.New().String() // when - resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/v2/service_instances/%s?accepts_incomplete=true", iid), + resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu20-staging/v2/service_instances/%s?accepts_incomplete=true", iid), `{ "service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281", "plan_id": "03b812ac-c991-4528-b5bd-08b303523a63", @@ -223,7 +223,6 @@ func TestProvisioning_HappyPathSapConvergedCloud(t *testing.T) { suite.AssertKymaResourceExists(opID) suite.AssertKymaAnnotationExists(opID, "compass-runtime-id-for-migration") suite.AssertKymaLabelsExist(opID, map[string]string{"kyma-project.io/region": "eu-de-1"}) - suite.AssertKymaLabelNotExists(opID, "kyma-project.io/platform-region") } func TestProvisioning_Preview(t *testing.T) { diff --git a/cmd/broker/suite_test.go b/cmd/broker/suite_test.go index aac25e38e4..b65b2c1594 100644 --- a/cmd/broker/suite_test.go +++ b/cmd/broker/suite_test.go @@ -999,8 +999,9 @@ func fixConfig() *Config { Deprovisioning: process.StagedManagerConfiguration{MaxStepProcessingTime: time.Minute}, Update: process.StagedManagerConfiguration{MaxStepProcessingTime: time.Minute}, - ArchiveEnabled: true, - CleaningEnabled: true, + ArchiveEnabled: true, + CleaningEnabled: true, + SapConvergedCloudRegionMappingsFilePath: "testdata/old-sap-converged-cloud-region-mappings.yaml", } } diff --git a/cmd/broker/testdata/old-sap-converged-cloud-region-mappings.yaml b/cmd/broker/testdata/old-sap-converged-cloud-region-mappings.yaml new file mode 100644 index 0000000000..41286e2a33 --- /dev/null +++ b/cmd/broker/testdata/old-sap-converged-cloud-region-mappings.yaml @@ -0,0 +1,2 @@ +cf-eu20-staging: + - eu-de-1