Explorar el Código

save and reset config.Project and config.Cluster

Mohammed Nafees hace 4 años
padre
commit
868302572b
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      cli/cmd/apply.go

+ 7 - 0
cli/cmd/apply.go

@@ -320,14 +320,21 @@ func (d *Driver) applyApplication(resource *models.Resource, client *api.Client,
 	if d.source.Name == "job" && appConfig.WaitForJob {
 		color.New(color.FgYellow).Printf("Waiting for job '%s' to finish\n", resource.Name)
 
+		prevProject := config.Project
+		prevCluster := config.Cluster
 		name = resource.Name
 		namespace = d.target.Namespace
+		config.Project = d.target.Project
+		config.Cluster = d.target.Cluster
 
 		err = waitForJob(nil, client, []string{})
 
 		if err != nil {
 			return nil, err
 		}
+
+		config.Project = prevProject
+		config.Cluster = prevCluster
 	}
 
 	return resource, err