Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iliax committed Jul 24, 2023
1 parent 79ba831 commit 4f27a39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ public Mono<ResponseEntity<PrometheusApiQueryResponseDTO>> getGraphData(String c
@Override
public Mono<ResponseEntity<GraphDescriptionsDTO>> getGraphsList(String clusterName,
ServerWebExchange exchange) {
var context = AccessContext.builder()
.cluster(clusterName)
.operationName("getGraphsList")
.build();

var graphs = graphsService.getGraphs(getCluster(clusterName));
return Mono.just(
ResponseEntity.ok(
new GraphDescriptionsDTO().graphs(graphs.map(this::map).toList())
)
);
return accessControlService.validateAccess(context).then(
Mono.just(ResponseEntity.ok(new GraphDescriptionsDTO().graphs(graphs.map(this::map).toList()))));
}

private GraphDescriptionDTO map(GraphDescription graph) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static MetricsSink create(ClustersProperties.Cluster cluster) {
return compoundSink(sinks);
}

static MetricsSink compoundSink(List<MetricsSink> sinks) {
private static MetricsSink compoundSink(List<MetricsSink> sinks) {
return metricsStream -> {
var materialized = metricsStream.toList();
return Flux.fromIterable(sinks)
Expand Down

0 comments on commit 4f27a39

Please sign in to comment.