Skip to content

Commit

Permalink
broker default unit test add
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchangyan committed Dec 12, 2022
1 parent 2ad62d2 commit c481170
Show file tree
Hide file tree
Showing 2 changed files with 353 additions and 51 deletions.
12 changes: 5 additions & 7 deletions pkg/apis/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,11 @@ func getBrokerClasses(d *Defaults) map[string]*BrokerConfigSpec {

// matchBrokerClass find the corresponding brokerConfig for a given brokerClass
func matchBrokerClass(brokerClass string, brokerClasses map[string]*BrokerConfigSpec) *BrokerConfig {
for bClass, bCSpec := range brokerClasses {
if bClass == brokerClass {
var bConfig BrokerConfig
bConfig.KReference = bCSpec.Spec.Config
bConfig.Delivery = bCSpec.Spec.Delivery
return &bConfig
}
var bConfig BrokerConfig
if bCSpec, ok := brokerClasses[brokerClass]; ok {
bConfig.KReference = bCSpec.Spec.Config
bConfig.Delivery = bCSpec.Spec.Delivery
return &bConfig
}
return nil
}
Loading

0 comments on commit c481170

Please sign in to comment.