Only set imagePlatform if it has text

See gh-43424
This commit is contained in:
Leonid Bogdanov 2024-12-05 13:49:44 +11:00 committed by Moritz Halbritter
parent 48bc3b6412
commit fe1f9b3002
1 changed files with 3 additions and 3 deletions

View File

@ -257,7 +257,7 @@ public class Image {
if (StringUtils.hasText(this.runImage)) {
request = request.withRunImage(ImageReference.of(this.runImage));
}
if (this.env != null && !this.env.isEmpty()) {
if (!CollectionUtils.isEmpty(this.env)) {
request = request.withEnv(this.env);
}
if (this.cleanCache != null) {
@ -295,10 +295,10 @@ public class Image {
if (StringUtils.hasText(this.applicationDirectory)) {
request = request.withApplicationDirectory(this.applicationDirectory);
}
if (this.securityOptions != null) {
if (!CollectionUtils.isEmpty(this.securityOptions)) {
request = request.withSecurityOptions(this.securityOptions);
}
if (this.imagePlatform != null) {
if (StringUtils.hasText(this.imagePlatform)) {
request = request.withImagePlatform(this.imagePlatform);
}
return request;