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:
committed by
Scott Frederick
parent
9d6a0cfd24
commit
dc36346285
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user