From d95675363be18ba55a8b09a31329c1d87d8bc4e0 Mon Sep 17 00:00:00 2001 From: kubevela-bot Date: Mon, 29 Mar 2021 12:27:19 +0000 Subject: [PATCH] kubevela(2d958006182e489fd1139ba7d4b421fc83025034) for refs/heads/master commit --- docs/application.md | 3 +-- docs/cue/component.md | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/application.md b/docs/application.md index 48a7d2db..b71a4511 100644 --- a/docs/application.md +++ b/docs/application.md @@ -151,7 +151,6 @@ After the `Application` resource is applied to Kubernetes cluster, the KubeVela |`app.oam.dev/name=` | The name of the application it belongs to | |`app.oam.dev/component=` | The name of the component it belongs to | |`trait.oam.dev/resource=` | The name of trait resource instance | - -> TBD: the revision names and labels for resource instances are currently work in progress. +|`app.oam.dev/appRevision=` | The name of the application revision it belongs to | > TBD: a demo for kubectl apply above Application CR and show full detailed underlying resources. diff --git a/docs/cue/component.md b/docs/cue/component.md index 0e474735..81e89c83 100644 --- a/docs/cue/component.md +++ b/docs/cue/component.md @@ -175,7 +175,7 @@ spec: KubeVela allows you to reference the runtime information of your application via `conext` keyword. -The most widely used context is application name(`context.appName`) and component name(`context.name`). +The most widely used context is application name(`context.appName`) component name(`context.name`). ```cue context: { @@ -204,7 +204,17 @@ output: { > Note that `context` information are auto-injected before resources are applied to target cluster. -> TBD: full available information in CUE `context`. +### Full available information in CUE `context` + +| Context Variable | Description | +| :--: | :---------: | +| `context.appRevision` | The revision of the application | +| `context.appName` | The name of the application | +| `context.name` | The name of the component of the application | +| `context.namespace` | The namespace of the application | +| `context.output` | The rendered workload API resource of the component, this usually used in trait | +| `context.outputs.` | The rendered trait API resource of the component, this usually used in trait | + ## Composition