code: function kindToResource(kind, humanize) {
      if (!kind) {
        return "";
      }
      var resource = kind;
      if (humanize) {
        var humanizeKind = $filter("humanizeKind");
        resource = humanizeKind(resource);
      }
      resource = String(resource).toLowerCase();
      if (resource === 'endpoints' || resource === 'securitycontextconstraints') {
        // no-op, plural is the singular
      }
      else if (resource[resource.length-1] === 's') {
        resource = resource + 'es';
      }
      else if (resource[resource.length-1] === 'y') {
        resource = resource.substring(0, resource.length-1) + 'ies';
      }
      else {
        resource = resource + 's';
      }
  
      return resource;
    }
docs: port of restmapper.go#kindToResource humanize will add spaces between words in the resource