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());
}
Aggregations