Skip to content

Commit

Permalink
Mark all broker configs as read-only in read-only clusters (#556)
Browse files Browse the repository at this point in the history
Co-authored-by: Roman Zabaluev <[email protected]>
  • Loading branch information
hadisfr and Haarolean committed Sep 28, 2024
1 parent 0bc9747 commit bec34c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public class InternalBrokerConfig {
private final boolean isReadOnly;
private final List<ConfigEntry.ConfigSynonym> synonyms;

public static InternalBrokerConfig from(ConfigEntry configEntry) {
public static InternalBrokerConfig from(ConfigEntry configEntry, boolean readOnlyCluster) {
InternalBrokerConfig.InternalBrokerConfigBuilder builder = InternalBrokerConfig.builder()
.name(configEntry.name())
.value(configEntry.value())
.source(configEntry.source())
.isReadOnly(configEntry.isReadOnly())
.isReadOnly(readOnlyCluster || configEntry.isReadOnly())
.isSensitive(configEntry.isSensitive())
.synonyms(configEntry.synonyms());
return builder.build();
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/io/kafbat/ui/service/BrokerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private Flux<InternalBrokerConfig> getBrokersConfig(KafkaCluster cluster, Intege
}
return loadBrokersConfig(cluster, brokerId)
.map(list -> list.stream()
.map(InternalBrokerConfig::from)
.map(configEntry -> InternalBrokerConfig.from(configEntry, cluster.isReadOnly()))
.collect(Collectors.toList()))
.flatMapMany(Flux::fromIterable);
}
Expand Down

0 comments on commit bec34c5

Please sign in to comment.