Skip to content

Commit

Permalink
minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
markdboyd committed Aug 22, 2023
1 parent ada79ab commit 610d988
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions services/elasticsearch/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func InitElasticsearchBroker(brokerDB *gorm.DB, settings *config.Settings, taskq
}

// initializeAdapter is the main function to create database instances
func initializeAdapter(plan catalog.ElasticsearchPlan, s *config.Settings, c *catalog.Catalog, logger lager.Logger) (ElasticsearchAdapter, response.Response) {
func initializeAdapter(plan catalog.ElasticsearchPlan, s *config.Settings, logger lager.Logger) (ElasticsearchAdapter, response.Response) {
var elasticsearchAdapter ElasticsearchAdapter

if s.Environment == "test" {
Expand Down Expand Up @@ -136,7 +136,7 @@ func (broker *elasticsearchBroker) CreateInstance(c *catalog.Catalog, id string,
return response.NewErrorResponse(http.StatusBadRequest, "There was an error initializing the instance. Error: "+err.Error())
}

adapter, adapterErr := initializeAdapter(plan, broker.settings, c, broker.logger)
adapter, adapterErr := initializeAdapter(plan, broker.settings, broker.logger)
if adapterErr != nil {
return adapterErr
}
Expand Down Expand Up @@ -179,7 +179,7 @@ func (broker *elasticsearchBroker) ModifyInstance(c *catalog.Catalog, id string,
if planErr != nil {
return planErr
}
adapter, adapterErr := initializeAdapter(plan, broker.settings, c, broker.logger)
adapter, adapterErr := initializeAdapter(plan, broker.settings, broker.logger)
if adapterErr != nil {
return adapterErr
}
Expand Down Expand Up @@ -225,7 +225,7 @@ func (broker *elasticsearchBroker) LastOperation(c *catalog.Catalog, id string,
return planErr
}

adapter, adapterErr := initializeAdapter(plan, broker.settings, c, broker.logger)
adapter, adapterErr := initializeAdapter(plan, broker.settings, broker.logger)
if adapterErr != nil {
return adapterErr
}
Expand Down Expand Up @@ -301,7 +301,7 @@ func (broker *elasticsearchBroker) BindInstance(c *catalog.Catalog, id string, b
}

// Get the correct database logic depending on the type of plan
adapter, adapterErr := initializeAdapter(plan, broker.settings, c, broker.logger)
adapter, adapterErr := initializeAdapter(plan, broker.settings, broker.logger)
if adapterErr != nil {
return adapterErr
}
Expand Down Expand Up @@ -338,7 +338,7 @@ func (broker *elasticsearchBroker) DeleteInstance(c *catalog.Catalog, id string,
return response.NewErrorResponse(http.StatusInternalServerError, "Unable to get instance password.")
}

adapter, adapterErr := initializeAdapter(plan, broker.settings, c, broker.logger)
adapter, adapterErr := initializeAdapter(plan, broker.settings, broker.logger)
if adapterErr != nil {
return adapterErr
}
Expand Down

0 comments on commit 610d988

Please sign in to comment.