Add option to customize cache volume names when building an image

This commit adds configuration to the Maven and Gradle plugins to
allow specifying the names of build and launch cache volumes provided
to the CNB builder.

See gh-28292
This commit is contained in:
Julian Liebig
2021-10-11 17:59:45 +02:00
committed by Scott Frederick
parent 9d6a0cfd24
commit dc36346285
8 changed files with 171 additions and 17 deletions

View File

@@ -41,6 +41,7 @@ import org.springframework.util.StringUtils;
* @author Scott Frederick
* @author Jeroen Meijer
* @author Rafael Ceccone
* @author Julian Liebig
* @since 2.3.0
*/
public class Image {
@@ -69,6 +70,8 @@ public class Image {
List<String> tags;
Map<String, String> cacheVolumeNames;
/**
* The name of the created image.
* @return the image name
@@ -212,6 +215,9 @@ public class Image {
if (!CollectionUtils.isEmpty(this.tags)) {
request = request.withTags(this.tags.stream().map(ImageReference::of).collect(Collectors.toList()));
}
if (this.cacheVolumeNames != null && !this.cacheVolumeNames.isEmpty()) {
request = request.withCacheVolumeNames(this.cacheVolumeNames);
}
return request;
}