|
|
@@ -7,6 +7,8 @@ import (
|
|
|
|
|
|
"github.com/go-chi/chi"
|
|
|
"github.com/porter-dev/porter/internal/forms"
|
|
|
+ "github.com/porter-dev/porter/internal/kubernetes"
|
|
|
+ "github.com/porter-dev/porter/internal/kubernetes/domain"
|
|
|
"github.com/porter-dev/porter/internal/models"
|
|
|
)
|
|
|
|
|
|
@@ -108,6 +110,28 @@ func (app *App) HandleListProjectClusters(w http.ResponseWriter, r *http.Request
|
|
|
extClusters := make([]*models.ClusterExternal, 0)
|
|
|
|
|
|
for _, cluster := range clusters {
|
|
|
+ form := &forms.K8sForm{
|
|
|
+ OutOfClusterConfig: &kubernetes.OutOfClusterConfig{
|
|
|
+ Repo: app.Repo,
|
|
|
+ DigitalOceanOAuth: app.DOConf,
|
|
|
+ Cluster: cluster,
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ var agent *kubernetes.Agent
|
|
|
+
|
|
|
+ if app.ServerConf.IsTesting {
|
|
|
+ agent = app.TestAgents.K8sAgent
|
|
|
+ } else {
|
|
|
+ agent, _ = kubernetes.GetAgentOutOfClusterConfig(form.OutOfClusterConfig)
|
|
|
+ }
|
|
|
+
|
|
|
+ endpoint, found, _ := domain.GetNGINXIngressServiceIP(agent.Clientset)
|
|
|
+
|
|
|
+ if found {
|
|
|
+ cluster.IngressIP = endpoint
|
|
|
+ }
|
|
|
+
|
|
|
extClusters = append(extClusters, cluster.Externalize())
|
|
|
}
|
|
|
|