All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.operatorsdk.deployment.GeneratedKubernetesManifestsProcessor Maven / Gradle / Ivy

There is a newer version: 6.8.4
Show newest version
package io.quarkiverse.operatorsdk.deployment;

import java.util.List;
import java.util.function.BooleanSupplier;

import org.eclipse.microprofile.config.ConfigProvider;

import io.quarkiverse.operatorsdk.common.DeserializedKubernetesResourcesBuildItem;
import io.quarkiverse.operatorsdk.common.GeneratedResourcesUtils;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.kubernetes.spi.GeneratedKubernetesResourceBuildItem;

public class GeneratedKubernetesManifestsProcessor {
    private static class NeedResourcesDeserialization implements BooleanSupplier {
        @Override
        public boolean getAsBoolean() {
            final var helmEnabled = ConfigProvider.getConfig()
                    .getOptionalValue("quarkus.operator-sdk.helm.enabled", Boolean.class).orElse(false);
            final var bundleEnabled = ConfigProvider.getConfig()
                    .getOptionalValue("quarkus.operator-sdk.bundle.enabled", Boolean.class).orElse(false);
            return helmEnabled || bundleEnabled;
        }
    }

    @BuildStep(onlyIf = NeedResourcesDeserialization.class)
    DeserializedKubernetesResourcesBuildItem deserializeGeneratedKubernetesResources(
            List generatedResources) {
        return new DeserializedKubernetesResourcesBuildItem(GeneratedResourcesUtils.loadFrom(generatedResources));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy