[INFRA-397] | Anoop | Log vault response on importing
This commit is contained in:
@@ -5,8 +5,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.view.RedirectView;
|
||||
|
||||
import java.security.Principal;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class LoginController {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.navi.infra.portal.domain.manifest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import com.navi.infra.portal.domain.JsonEntity;
|
||||
import com.navi.infra.portal.domain.manifest.Deployment;
|
||||
import com.navi.infra.portal.events.LoadBalancerChangesListener;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.navi.infra.portal.bash;
|
||||
package com.navi.infra.portal.service.kubernetes;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.navi.infra.portal.service.kubernetes;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.navi.infra.portal.bash.BashExecute;
|
||||
import com.navi.infra.portal.client.KubeClient;
|
||||
import com.navi.infra.portal.domain.manifest.Deployment;
|
||||
import com.navi.infra.portal.domain.manifest.Manifest;
|
||||
@@ -320,7 +319,7 @@ public class KubernetesManifestService {
|
||||
String clusterName = (String) manifest.getDeployment().getData().get("cluster");
|
||||
String namespace = (String) manifest.getDeployment().getData().get("namespace");
|
||||
String command = String
|
||||
.format("kubectl delete %s %s -n %s --context=%s", kubeObjectType, kubeObject, namespace, clusterName);
|
||||
.format("kubectl delete --ignore-not-found %s %s -n %s --context=%s", kubeObjectType, kubeObject, namespace, clusterName);
|
||||
log.info("Executing command {}", command);
|
||||
|
||||
try {
|
||||
|
||||
@@ -125,7 +125,11 @@ public class ManifestService {
|
||||
public void importManifest(String deploymentManifestJson, String vaultPath, String environment) {
|
||||
VaultResponse vaultResponse = vaultService.fetchConfig(vaultPath);
|
||||
final String[] manifestWrapper = new String[]{deploymentManifestJson};
|
||||
|
||||
if (!vaultResponse.isOk()) {
|
||||
throw new RuntimeException(String
|
||||
.format("Unable to read secrets from vault because of: %s", vaultResponse));
|
||||
}
|
||||
|
||||
vaultResponse.getData().
|
||||
forEach((key, value) -> manifestWrapper[0] = manifestWrapper[0].replaceAll(String.format("\\$%s", key), value));
|
||||
deploymentManifestJson = manifestWrapper[0];
|
||||
|
||||
@@ -46,7 +46,7 @@ local load_balancer_spec = {
|
||||
// Creates a kubernetes headless service
|
||||
none: {
|
||||
type: 'ClusterIP',
|
||||
ports: port_map.getPortsforClusterIPService
|
||||
ports: port_map.getPortsforClusterIPService,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user