oam-dev / spec

Open Application Model (OAM).
https://oam.dev
Other
3.06k stars 247 forks source link

Add metadata.short in TraitDefinition #379

Closed zzxwill closed 4 years ago

zzxwill commented 4 years ago

To achieve a good experience for typing a very long trait name in OAM Cli, we should use its short name. Similar to the workload definition design from @wonderflow, a short name for trait should also be set in the Template manifest. So propose metadata.short reflects in TraitDefinition as below.

apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
  name: simplerollouttraits.extend.oam.dev
  annotations:
    defatultTemplateRef: simplerollouttraits.extend.oam.dev-template
    short: SimpleRollout
spec:
  revisionEnabled: true
  appliesToWorkloads:
    - core.oam.dev/v1alpha2.ContainerizedWorkload
    - deployments.apps
  definitionRef:
    name: simplerollouttraits.extend.oam.dev