From e773ba50bcbf21102db27e42e4ed5b1da390df86 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 30 Jun 2023 09:52:28 +0200 Subject: [PATCH] fallback option --- ...esToOpenShiftFallbackConfigSourceInterceptor.java | 12 ++++++++++++ .../io.smallrye.config.ConfigSourceInterceptor | 1 + 2 files changed, 13 insertions(+) create mode 100644 extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/config/KubernetesToOpenShiftFallbackConfigSourceInterceptor.java create mode 100644 extensions/kubernetes/vanilla/deployment/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/config/KubernetesToOpenShiftFallbackConfigSourceInterceptor.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/config/KubernetesToOpenShiftFallbackConfigSourceInterceptor.java new file mode 100644 index 0000000000000..9490ed91d5be5 --- /dev/null +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/config/KubernetesToOpenShiftFallbackConfigSourceInterceptor.java @@ -0,0 +1,12 @@ +package io.quarkus.kubernetes.deployment.config; + +import io.smallrye.config.FallbackConfigSourceInterceptor; + +public class KubernetesToOpenShiftFallbackConfigSourceInterceptor extends FallbackConfigSourceInterceptor { + public KubernetesToOpenShiftFallbackConfigSourceInterceptor() { + super(name -> { + return name.startsWith("quarkus.kubernetes") ? name.replaceAll("quarkus\\.kubernetes", "quarkus.openshift") + : name; + }); + } +} diff --git a/extensions/kubernetes/vanilla/deployment/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor b/extensions/kubernetes/vanilla/deployment/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor new file mode 100644 index 0000000000000..a9e5920690a76 --- /dev/null +++ b/extensions/kubernetes/vanilla/deployment/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor @@ -0,0 +1 @@ +io.quarkus.kubernetes.deployment.config.KubernetesToOpenShiftFallbackConfigSourceInterceptor \ No newline at end of file