From 302e29b0546058a798a161f51b1c4350a9da9f3d Mon Sep 17 00:00:00 2001
From: Mingyang Zhu <mzhu9@slb.com>
Date: Thu, 13 May 2021 07:19:34 -0500
Subject: [PATCH] mark DefaultHealthCheckImpl ConditionalOnMissingBean

---
 devops/azure/release.yaml                                 | 6 +++++-
 .../osdu/partition/service/DefaultHealthCheckImpl.java    | 2 ++
 .../provider/azure/service/HealthCheckServiceImpl.java    | 8 ++------
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/devops/azure/release.yaml b/devops/azure/release.yaml
index b45c367aa..1d1d4afdd 100644
--- a/devops/azure/release.yaml
+++ b/devops/azure/release.yaml
@@ -74,7 +74,11 @@ spec:
         - containerPort: 80
         readinessProbe:
           httpGet:
-            path: /api/partition/v1/swagger-ui.html
+            path: /api/partition/v1/_ah/readiness_check
+            port: 80
+        livenessProbe:
+          httpGet:
+            path: /api/partition/v1/_ah/liveness_check
             port: 80
         volumeMounts:
         - name: azure-keyvault
diff --git a/partition-core/src/main/java/org/opengroup/osdu/partition/service/DefaultHealthCheckImpl.java b/partition-core/src/main/java/org/opengroup/osdu/partition/service/DefaultHealthCheckImpl.java
index 102bffb95..1d911bc5b 100644
--- a/partition-core/src/main/java/org/opengroup/osdu/partition/service/DefaultHealthCheckImpl.java
+++ b/partition-core/src/main/java/org/opengroup/osdu/partition/service/DefaultHealthCheckImpl.java
@@ -1,9 +1,11 @@
 package org.opengroup.osdu.partition.service;
 
 import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.stereotype.Service;
 
 @Service
+@ConditionalOnMissingBean
 public class DefaultHealthCheckImpl implements IHealthCheckService {
 
     @Override
diff --git a/provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/service/HealthCheckServiceImpl.java b/provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/service/HealthCheckServiceImpl.java
index f18b5b4c3..1917f77ac 100644
--- a/provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/service/HealthCheckServiceImpl.java
+++ b/provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/service/HealthCheckServiceImpl.java
@@ -4,23 +4,19 @@ import lombok.RequiredArgsConstructor;
 import org.opengroup.osdu.partition.model.PartitionInfo;
 import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService;
 import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache;
+import org.opengroup.osdu.partition.service.DefaultHealthCheckImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
 @Service
 @RequiredArgsConstructor
-public class HealthCheckServiceImpl implements IHealthCheckService {
+public class HealthCheckServiceImpl extends DefaultHealthCheckImpl {
 
     @Autowired
     @Qualifier("partitionServiceCache")
     private IPartitionServiceCache<String, PartitionInfo> partitionServiceCache;
 
-    @Override
-    public void performLivenessCheck() {
-
-    }
-
     /**
      * Cache layer must be ready before the pod can serve the traffic
      */
-- 
GitLab