INFRA-3388 | Saqib | Fixes checkstyle warnings

This commit is contained in:
Saqib Perwaiz
2024-08-27 12:21:20 +05:30
parent 048775cd2c
commit 1e1c6a9509
2 changed files with 11 additions and 10 deletions

View File

@@ -29,14 +29,14 @@ public interface ManifestRepository extends JpaRepository<Manifest, Long> {
+ "where lb.data ->> 'endpoint' = :endpoint ", nativeQuery = true)
Optional<Long> findIdByEndpoint(String endpoint);
@Query(value = "SELECT " +
"CASE " +
"WHEN CAST(d.data AS jsonb) -> 'exposedPorts' @> CAST('[{\"name\": \"secondary-service-port\"}]' AS jsonb) THEN true " +
"ELSE false " +
"END as has_secondary_service_port " +
"FROM manifest m " +
"JOIN deployment d ON m.id = d.manifest_id " +
"WHERE m.id = :manifestId", nativeQuery = true)
@Query(value = "SELECT "
+ "CASE "
+ "WHEN CAST(d.data AS jsonb) -> 'exposedPorts' @> CAST('[{\"name\": \"secondary-service-port\"}]' AS jsonb) THEN true "
+ "ELSE false "
+ "END as has_secondary_service_port "
+ "FROM manifest m "
+ "JOIN deployment d ON m.id = d.manifest_id "
+ "WHERE m.id = :manifestId", nativeQuery = true)
boolean hasSecondaryServicePort(@Param("manifestId") Long manifestId);
}

View File

@@ -266,10 +266,11 @@ public class KubeOperationService {
}
private void deleteExposedIngress(Long manifestId, KIngress resource) {
KIngress exposedIngress = new KIngress(resource.getName()+"-exposed",
KIngress exposedIngress = new KIngress(resource.getName() + "-exposed",
resource.getNameSpace());
try {
log.info("Deleting additional exposed ingress {} ,manifestId={}", exposedIngress.getName(), manifestId);
log.info("Deleting additional exposed ingress {} ,manifestId={}",
exposedIngress.getName(), manifestId);
kubeClient.deleteNamespacedObject(exposedIngress);
} catch (ApiException e) {
if (e.getCode() == HttpStatus.NOT_FOUND.value()) {