|
1 | 1 | package io.kafbat.ui.controller;
|
2 | 2 |
|
3 | 3 | import io.kafbat.ui.api.BrokersApi;
|
4 |
| -import io.kafbat.ui.config.Config; |
5 |
| -import io.kafbat.ui.exception.ClusterNotFoundException; |
6 | 4 | import io.kafbat.ui.mapper.ClusterMapper;
|
7 | 5 | import io.kafbat.ui.model.BrokerConfigDTO;
|
8 | 6 | import io.kafbat.ui.model.BrokerConfigItemDTO;
|
@@ -32,7 +30,6 @@ public class BrokersController extends AbstractController implements BrokersApi
|
32 | 30 |
|
33 | 31 | private final BrokerService brokerService;
|
34 | 32 | private final ClusterMapper clusterMapper;
|
35 |
| - private final Config config; |
36 | 33 |
|
37 | 34 | @Override
|
38 | 35 | public Mono<ResponseEntity<Flux<BrokerDTO>>> getBrokers(String clusterName,
|
@@ -97,14 +94,10 @@ public Mono<ResponseEntity<Flux<BrokerConfigDTO>>> getBrokerConfig(String cluste
|
97 | 94 | .operationParams(Map.of(BROKER_ID, id))
|
98 | 95 | .build();
|
99 | 96 |
|
100 |
| - Flux<BrokerConfigDTO> brokerConfigs = brokerService.getBrokerConfig(getCluster(clusterName), id) |
| 97 | + var kafkaCluster = getCluster(clusterName); |
| 98 | + Flux<BrokerConfigDTO> brokerConfigs = brokerService.getBrokerConfig(kafkaCluster, id) |
101 | 99 | .map(clusterMapper::toBrokerConfig);
|
102 | 100 |
|
103 |
| - var kafkaCluster = clustersStorage.getClusterByName(clusterName) |
104 |
| - .orElseThrow( |
105 |
| - () -> new ClusterNotFoundException( |
106 |
| - String.format("No cluster for name '%s'", clusterName))); |
107 |
| - |
108 | 101 | if (kafkaCluster.isReadOnly()) {
|
109 | 102 | brokerConfigs = brokerConfigs.map(config -> {
|
110 | 103 | config.setIsReadOnly(true);
|
|
0 commit comments