monocular icon indicating copy to clipboard operation
monocular copied to clipboard

Can we make api/v1/releases response more readable?

Open fkpwolf opened this issue 7 years ago • 2 comments

It is to get details of a deployed chart. Look like:

{
  "data": {
    "attributes": {
      "chartIcon": "",
      "chartName": "monocular",
      "chartVersion": "0.5.4",
      "name": "erstwhile-deer",
      "namespace": "default",
      "notes": "The Monocular chart sets up an Ingress to serve the API and UI on the same\ndomain. You can get the address to access Monocular from this Ingress endpoint:\n\n  $ kubectl get ingress erstwhile-deer-monocular\n\nVisit https://github.com/kubernetes-helm/monocular for more information.\n\n**IMPORTANT**: Releases are enabled, which will allow anybody with access to the running instance to create, list and delete any Helm release existing in your cluster.\nThis feature is aimed for internal, behind the firewall deployments of Monocular, please plan accordingly. To disable this, re-install Monocular setting api.config.releasesEnabled=false.\n\n\nMonocular expects tiller-deploy to be found in namespace kube-system\n",
      "resources": "==\u003e v1/Service\nNAME                     TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)     AGE\nerstwhile-deer-mongodb   ClusterIP   10.106.165.223   \u003cnone\u003e        27017/TCP   1h\nerstwhile-deer-monocular-api   NodePort   10.105.248.70   \u003cnone\u003e    80:32617/TCP   1h\nerstwhile-deer-monocular-prerender   NodePort   10.98.156.142   \u003cnone\u003e    80:31201/TCP   1h\nerstwhile-deer-monocular-ui   NodePort   10.103.234.64   \u003cnone\u003e    80:30603/TCP   1h\n\n==\u003e v1beta1/Deployment\nNAME                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\nerstwhile-deer-mongodb   1         1         1            1           1h\nerstwhile-deer-monocular-api   2         2         2         2         1h\nerstwhile-deer-monocular-prerender   1         1         1         1         1h\nerstwhile-deer-monocular-ui   2         2         2         2         1h\n\n==\u003e v1beta1/Ingress\nNAME                       HOSTS                            ADDRESS   PORTS     AGE\nerstwhile-deer-monocular   monocular.192.168.51.11.nip.io             80        1h\n\n==\u003e v1/Pod(related)\nNAME                                    READY     STATUS    RESTARTS   AGE\nerstwhile-deer-mongodb-5dff6c64-x22hs   1/1       Running   0          1h\nerstwhile-deer-monocular-api-74695997fd-c6j9x   1/1       Running   14        1h\nerstwhile-deer-monocular-api-74695997fd-qvrg8   1/1       Running   9         1h\nerstwhile-deer-monocular-prerender-d556b95c9-k8n6x   1/1       Running   0         1h\nerstwhile-deer-monocular-ui-848c9c79b-4z4l6   1/1       Running   0         1h\nerstwhile-deer-monocular-ui-848c9c79b-wm9ng   1/1       Running   0         1h\n\n==\u003e v1/Secret\nNAME                     TYPE      DATA      AGE\nerstwhile-deer-mongodb   Opaque    2         1h\n\n==\u003e v1/ConfigMap\nNAME                                  DATA      AGE\nerstwhile-deer-monocular-api-config   1         1h\nerstwhile-deer-monocular-ui-config   1         1h\nerstwhile-deer-monocular-ui-vhost   1         1h\n\n==\u003e v1/PersistentVolumeClaim\nNAME                     STATUS    VOLUME          CAPACITY   ACCESS MODES   STORAGECLASS   AGE\nerstwhile-deer-mongodb   Bound     nfs-monocular   10Gi       RWO                           1h\n\n",
      "status": "DEPLOYED",
      "updated": "Thu May 31 07:24:05 2018"
    },
    "id": "erstwhile-deer",
    "type": "release"
  }
}

The "resources" part is raw string and not a format JSON. I saw JavaScript part does lots of effort to parser the string and display it. Can we make it more readable? Does it get from Helm command directly?

fkpwolf avatar May 31 '18 08:05 fkpwolf

We get this directly from Helm, yes, and unfortunately I don't believe there is a way to get structured data.

cc @migmartri who may know more.

prydonius avatar May 31 '18 20:05 prydonius

I see. But anyway I think we can move the ugly JavaScript which do regex to parse string to backend.

fkpwolf avatar Jun 05 '18 12:06 fkpwolf