public static boolean isImageBuildPushRequired(ServiceSpec serviceSpec) {
        if (serviceSpec == null) {
            return false;
        }
        Image image = null;
        try {
            image = serviceSpec.get(HyscaleSpecFields.image, Image.class);
        } catch (HyscaleException e) {
            logger.info("Error while fetching buildSpec and registryUrl from serviceSpec ");
        }

        if (image == null) {
            return false;
        }

        return image instanceof BuildSpecImage || image instanceof DockerBuildImage;
    }
Checks if service spec requires image build or push operation
Build or push required if service spec contains build spec or dockerfile filed in image

@param serviceSpec
@return true if build or push required else false
service-spec/service-spec-commons/src/main/java/io/hyscale/servicespec/commons/util/ImageUtil.java