hawtio / hawtio-kubernetes

hawtio plugin for working with kubernetes
Apache License 2.0
24 stars 14 forks source link

support yaml for the json schema markup for the ConfigMap page #131

Closed jstrachan closed 7 years ago

jstrachan commented 7 years ago

its a PITA trying to write json schema in json inside an annotation inside a yaml manifest. But YAML should be kinda easy - as its simple to nest YAML in an annotation in YAML.

So I wonder if we should support, either YAML encoding in the fabric8.io/json-schema annotation - or we make the ConfigMap code also detect fabric8.io/yaml-schema? for YAML encoded json schema? Then it'd be easier to hand-craft some json schema structure into ConfigMaps?

gashcrumb commented 7 years ago

Yeah, it'd be pretty easy to do, we've already got a 'yaml to javascript object' converter available.

gashcrumb commented 7 years ago

So I have this working nicely:

kind: ConfigMap
apiVersion: v1
metadata:
  name: spring-boot-webmvc
  namespace: default
  selfLink: /api/v1/namespaces/default/configmaps/spring-boot-webmvc
  uid: a2e4d692-7b4a-11e6-a421-bef25813b997
  resourceVersion: '26526'
  creationTimestamp: '2016-09-15T13:45:17Z'
  labels:
    group: io.fabric8.quickstarts
    project: spring-boot-webmvc
    provider: fabric8
    version: 1.0-SNAPSHOT
  annotations:
    fabric8.io/yaml-schema: |-
      properties:
        foo:
          type: string
        application_properties:
          type: string
data:
  application-properties: |
    # spring application proeprties file
    welcome = Hello from Kubernetes ConfigMap!!!
    dummy = some value
  foo: bar
jstrachan commented 7 years ago

Lovely!