apiVersion: v1
kind: ConfigMap
metadata:
  name: stock-trader.actions.deployment-liberty.loyalty-level
  namespace: stock-trader
  labels: 
    kappnav.io/map-type: action
data:
  url-actions: |
    [
      { 
        "name":"loyalty-home", 
        "text":"View Home Page", 
        "text.nls": "View Home Page",
        "description":"View loyalty-level home page.", 
        "description.nls": "View loyalty-level home page.",
        "url-pattern":"http://${snippet.get_route_host(${func.kubectlGet(Route,${resource.$.metadata.name},-n,${resource.$.metadata.namespace},-o,json)})}",
        "open-window": "tab", 
        "menu-item": "true"
      }
    ]
  snippets: |
    {
        "get_route_host": "function getRouteHost(route) { 
            var routeJSON = JSON.parse(route);
            var host = routeJSON.spec.host;
            return host;
        }"
    }
