diff --git a/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/util/EnablementUtil.java b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/util/EnablementUtil.java index 525a191af411a..d37be2436298c 100644 --- a/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/util/EnablementUtil.java +++ b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/util/EnablementUtil.java @@ -17,7 +17,9 @@ public static boolean buildContainerImageNeeded(ContainerImageConfig containerIm public static boolean pushContainerImageNeeded(ContainerImageConfig containerImageConfig, Optional pushRequest) { return containerImageConfig.isPushExplicitlyEnabled() - || (pushRequest.isPresent() && !containerImageConfig.isPushExplicitlyDisabled()); + // Never push an image when build is disabled (it may not even exist). + || (pushRequest.isPresent() && !containerImageConfig.isBuildExplicitlyDisabled() + && !containerImageConfig.isPushExplicitlyDisabled()); } public static boolean buildOrPushContainerImageNeeded(ContainerImageConfig containerImageConfig,