Fix bug 1216: Remove machines only for native charms
[osm/N2VC.git] / n2vc / kubectl.py
index 5836756..61b2dc3 100644 (file)
@@ -37,7 +37,18 @@ class Kubectl:
                     "name": i.metadata.name,
                     "cluster_ip": i.spec.cluster_ip,
                     "type": i.spec.type,
-                    "ports": i.spec.ports,
+                    "ports": [
+                        {
+                            "name": p.name,
+                            "node_port": p.node_port,
+                            "port": p.port,
+                            "protocol": p.protocol,
+                            "target_port": p.target_port,
+                        }
+                        for p in i.spec.ports
+                    ]
+                    if i.spec.ports
+                    else [],
                     "external_ip": [i.ip for i in i.status.load_balancer.ingress]
                     if i.status.load_balancer.ingress
                     else None,