Version: v1.2

Version Control for Definition

When the capabilities(Component or Trait) changes, KubeVela will generate a definition revision automatically.

  • Check ComponentDefinition Revision
  1. $ kubectl get definitionrevision -l="componentdefinition.oam.dev/name=webservice" -n vela-system
  2. NAME REVISION HASH TYPE
  3. webservice-v1 1 3f6886d9832021ba Component
  4. webservice-v2 2 b3b9978e7164d973 Component
  • Check TraitDefinition Revision
  1. $ kubectl get definitionrevision -l="trait.oam.dev/name=rollout" -n vela-system
  2. NAME REVISION HASH TYPE
  3. rollout-v1 1 e441f026c1884b14 Trait

The best way to control version is using a new name for every definition version.

Specify Component/Trait Capability Revision in Application

Users can specify the revision with @version approach, for example, if a user want to stick to using the v1 revision of webservice component.

System admin can also write a webhook to inject the version automatically.

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: myapp
  5. spec:
  6. components:
  7. - name: express-server
  8. type: webservice@v1
  9. properties:
  10. image: stefanprodan/podinfo:4.0.3

In this way, if system admin changes the ComponentDefinition, it won’t affect your application.

If no revision specified, KubeVela will always use the latest revision when you upgrade your application.