use of io.stackgres.operator.customresource.prometheus.PrometheusInstallation in project stackgres by ongres.
the class ClusterRequiredResourcesGenerator method toPrometheusInstallation.
private static PrometheusInstallation toPrometheusInstallation(PrometheusConfig pc) {
Map<String, String> matchLabels = Optional.ofNullable(pc.getSpec()).map(PrometheusConfigSpec::getServiceMonitorSelector).map(LabelSelector::getMatchLabels).map(Map::copyOf).orElse(Map.of());
PrometheusInstallation pi = new PrometheusInstallation();
pi.setNamespace(pc.getMetadata().getNamespace());
pi.setMatchLabels(matchLabels);
return pi;
}
Aggregations