Search in sources :

Example 1 with WatchImageConfiguration

use of org.eclipse.jkube.kit.config.image.WatchImageConfiguration in project jkube by eclipse.

the class PropertyConfigHandler method resolve.

@Override
public List<ImageConfiguration> resolve(ImageConfiguration fromConfig, JavaProject project) {
    Map<String, String> externalConfig = fromConfig.getExternalConfig();
    String prefix = getPrefix(externalConfig);
    Properties properties = JKubeProjectUtil.getPropertiesWithSystemOverrides(project);
    PropertyMode propertyMode = getMode(externalConfig);
    ValueProvider valueProvider = new ValueProvider(prefix, properties, propertyMode);
    RunImageConfiguration run = extractRunConfiguration(fromConfig, valueProvider);
    BuildConfiguration build = extractBuildConfiguration(fromConfig, valueProvider, project);
    WatchImageConfiguration watch = extractWatchConfig(fromConfig, valueProvider);
    String name = valueProvider.getString(NAME, fromConfig.getName());
    String alias = valueProvider.getString(ALIAS, fromConfig.getAlias());
    if (name == null) {
        throw new IllegalArgumentException(String.format("Mandatory property [%s] is not defined", NAME));
    }
    return Collections.singletonList(ImageConfiguration.builder().name(name).alias(alias).run(run).build(build).watch(watch).build());
}
Also used : BuildConfiguration(org.eclipse.jkube.kit.config.image.build.BuildConfiguration) WatchImageConfiguration(org.eclipse.jkube.kit.config.image.WatchImageConfiguration) Properties(java.util.Properties) RunImageConfiguration(org.eclipse.jkube.kit.config.image.RunImageConfiguration)

Aggregations

Properties (java.util.Properties)1 RunImageConfiguration (org.eclipse.jkube.kit.config.image.RunImageConfiguration)1 WatchImageConfiguration (org.eclipse.jkube.kit.config.image.WatchImageConfiguration)1 BuildConfiguration (org.eclipse.jkube.kit.config.image.build.BuildConfiguration)1