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
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.
* @return ApiClient
* @throws IOException exception
*/
+ @Profile("kubernetes")
@Bean
public ApiClient defaultApiClient() throws IOException {
return Config.fromCluster();