diff --git a/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/appcds/AppCDSRecorder.java b/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/appcds/AppCDSRecorder.java index 70e03db0d35455..1f5e5a37b5b832 100644 --- a/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/appcds/AppCDSRecorder.java +++ b/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/appcds/AppCDSRecorder.java @@ -7,8 +7,10 @@ @Recorder public class AppCDSRecorder { + public static final String QUARKUS_APPCDS_GENERATE_PROP = "quarkus.appcds.generate"; + public void controlGenerationAndExit() { - if (Boolean.parseBoolean(System.getProperty("quarkus.appcds.generate", "false"))) { + if (Boolean.parseBoolean(System.getProperty(QUARKUS_APPCDS_GENERATE_PROP, "false"))) { InitializationTaskRecorder.preventFurtherRecorderSteps(5, "Unable to properly shutdown Quarkus application when creating AppCDS", PreventFurtherStepsException::new); diff --git a/extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactoryBuilder.java b/extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactoryBuilder.java index 1cd67db69e6e45..f533fd7202f539 100644 --- a/extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactoryBuilder.java +++ b/extensions/kubernetes-config/runtime/src/main/java/io/quarkus/kubernetes/config/runtime/KubernetesConfigSourceFactoryBuilder.java @@ -2,9 +2,12 @@ import static io.smallrye.config.Converters.getImplicitConverter; +import java.util.Collections; + import org.eclipse.microprofile.config.spi.ConfigSource; import io.fabric8.kubernetes.client.KubernetesClient; +import io.quarkus.arc.runtime.appcds.AppCDSRecorder; import io.quarkus.kubernetes.client.runtime.KubernetesClientBuildConfig; import io.quarkus.kubernetes.client.runtime.KubernetesClientUtils; import io.quarkus.runtime.TlsConfig; @@ -23,6 +26,12 @@ static class KubernetesConfigFactory implements ConfigurableConfigSourceFactory< @Override public Iterable getConfigSources(final ConfigSourceContext context, final KubernetesClientBuildConfig config) { + boolean inAppCDsGeneration = getImplicitConverter(Boolean.class) + .convert(context.getValue(AppCDSRecorder.QUARKUS_APPCDS_GENERATE_PROP).getValue()); + if (inAppCDsGeneration) { + return Collections.emptyList(); + } + // TODO - TlsConfig is used in a lot of place. This is to avoid having it to migrate to ConfigMapping. boolean trustAll = getImplicitConverter(Boolean.class) .convert(context.getValue("quarkus.tls.trust-all").getValue());