[INFRA-19] | Piyush | Change kubectl command to use cluster context with each request

This commit is contained in:
Piyush Sinha
2020-07-23 00:33:23 +05:30
parent db8d1a5bb5
commit c00b504389

View File

@@ -87,8 +87,8 @@ public class KubernetesManifestService {
private void applyManifest(Manifest manifest, String kManifestPath, String manifestObject) {
String clusterName = fetchClusterName(manifest);
String command = String
.format("kubectl config use-context %s ; kubectl apply -f %s/*%s.json",
clusterName, kManifestPath, manifestObject);
.format("kubectl apply -f %s/*%s.json --context=%s", kManifestPath, manifestObject,
clusterName);
log.info("Executing command {}", command);
if (BashExecute.execute(command) > 0) {