All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.helm.deployment.rules.ConfigReferenceStrategyManager Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
package io.quarkiverse.helm.deployment.rules;

import java.util.List;
import java.util.Optional;

import io.dekorate.ConfigReference;

public final class ConfigReferenceStrategyManager {

    private static final List CONFIG_REFERENCE_STRATEGIES = List.of(
            new HttpGetPortConfigReferenceStrategy());

    private ConfigReferenceStrategyManager() {

    }

    public static ConfigReference visit(ConfigReference configReference) {
        for (ConfigReferenceStrategy strategy : CONFIG_REFERENCE_STRATEGIES) {
            for (int i = 0; i < configReference.getPaths().length; i++) {
                Optional newPath = strategy.visitPath(configReference, configReference.getPaths()[i]);
                if (newPath.isPresent()) {
                    configReference.getPaths()[i] = newPath.get();
                }
            }
        }

        return configReference;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy