Explorar el Código

catch error for handle read cluster

Alexander Belanger hace 4 años
padre
commit
18187b70d3
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      server/api/cluster_handler.go

+ 6 - 1
server/api/cluster_handler.go

@@ -98,7 +98,12 @@ func (app *App) HandleReadProjectCluster(w http.ResponseWriter, r *http.Request)
 	if app.ServerConf.IsTesting {
 		agent = app.TestAgents.K8sAgent
 	} else {
-		agent, _ = kubernetes.GetAgentOutOfClusterConfig(form.OutOfClusterConfig)
+		agent, err = kubernetes.GetAgentOutOfClusterConfig(form.OutOfClusterConfig)
+
+		if err != nil {
+			app.handleErrorInternal(err, w)
+			return
+		}
 	}
 
 	endpoint, found, ingressErr := domain.GetNGINXIngressServiceIP(agent.Clientset)