Search in sources :

Example 1 with PrometheusInstallation

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;
}
Also used : LabelSelector(io.fabric8.kubernetes.api.model.LabelSelector) PrometheusInstallation(io.stackgres.operator.customresource.prometheus.PrometheusInstallation)

Aggregations

LabelSelector (io.fabric8.kubernetes.api.model.LabelSelector)1 PrometheusInstallation (io.stackgres.operator.customresource.prometheus.PrometheusInstallation)1