From: aravind.est Date: Wed, 8 Mar 2023 15:08:44 +0000 (+0000) Subject: Add kubernetes configuration fetching based on profile. X-Git-Tag: 6.4.2~7 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F133583%2F1;p=policy%2Fclamp.git Add kubernetes configuration fetching based on profile. Fetch the kubernetes configuration from cluster only when the container runs on kubernetes cluster. This allows the container to run in a docker-compose based deployment. Issue-ID: POLICY-4574 Signed-off-by: aravind.est Change-Id: If12895c17734e87c327dda73ace0a91947f98022 --- diff --git a/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/Application.java b/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/Application.java index c5299e235..04bfd36ad 100755 --- a/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/Application.java +++ b/participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/Application.java @@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.ConfigurationPropertiesScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Profile; /** * Starter. @@ -54,6 +55,7 @@ public class Application { * @return ApiClient * @throws IOException exception */ + @Profile("kubernetes") @Bean public ApiClient defaultApiClient() throws IOException { return Config.fromCluster();