commit | 4f15b44c04a6f328f1a3357b859482c147fba0cd | [log] [tgz] |
---|---|---|
author | aravind.est <aravindhan.a@est.tech> | Wed Mar 08 15:08:44 2023 +0000 |
committer | aravind.est <aravindhan.a@est.tech> | Wed Mar 08 15:10:09 2023 +0000 |
tree | 51c692cb237287adc32353c1980960b315fb2a28 | |
parent | 7c4e1a2a23a0f0e2daf23fce7130a4327af25776 [diff] |
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 <aravindhan.a@est.tech> 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 c5299e2..04bfd36 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.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 @@ * @return ApiClient * @throws IOException exception */ + @Profile("kubernetes") @Bean public ApiClient defaultApiClient() throws IOException { return Config.fromCluster();