From efb76ee5ee16a09aaba4b4e612b3165436852e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=85=83?= Date: Mon, 16 Nov 2020 14:07:38 +0800 Subject: [PATCH] tunning docs --- .../templates/defwithtemplate/manualscale.yaml | 4 ++-- .../templates/defwithtemplate/metrics.yaml | 4 ++-- .../templates/defwithtemplate/rollout.yaml | 8 ++++---- design/api/vela-restful-api-reference.md | 12 ++++++------ design/vela-core/appfile-design.md | 4 ++-- docs/_sidebar.md | 2 +- docs/en/cli/vela.md | 7 ++++++- docs/en/cli/vela_autoscale.md | 16 ++++++++-------- docs/en/cli/vela_cap.md | 2 +- docs/en/cli/vela_cap_center.md | 2 +- docs/en/cli/vela_cap_center_config.md | 2 +- docs/en/cli/vela_cap_center_ls.md | 2 +- docs/en/cli/vela_cap_center_remove.md | 2 +- docs/en/cli/vela_cap_center_sync.md | 2 +- docs/en/cli/vela_cap_install.md | 2 +- docs/en/cli/vela_cap_ls.md | 2 +- docs/en/cli/vela_cap_uninstall.md | 2 +- docs/en/cli/vela_completion.md | 2 +- docs/en/cli/vela_completion_bash.md | 2 +- docs/en/cli/vela_completion_zsh.md | 2 +- docs/en/cli/vela_config.md | 2 +- docs/en/cli/vela_config_del.md | 2 +- docs/en/cli/vela_config_get.md | 2 +- docs/en/cli/vela_config_ls.md | 2 +- docs/en/cli/vela_config_set.md | 2 +- docs/en/cli/vela_dashboard.md | 2 +- docs/en/cli/vela_delete.md | 2 +- docs/en/cli/vela_env.md | 2 +- docs/en/cli/vela_env_delete.md | 2 +- docs/en/cli/vela_env_init.md | 2 +- docs/en/cli/vela_env_ls.md | 2 +- docs/en/cli/vela_env_set.md | 2 +- docs/en/cli/vela_exec.md | 2 +- docs/en/cli/vela_init.md | 2 +- docs/en/cli/vela_install.md | 2 +- docs/en/cli/vela_logs.md | 2 +- docs/en/cli/vela_ls.md | 2 +- docs/en/cli/{vela_metric.md => vela_metrics.md} | 16 ++++++++-------- docs/en/cli/vela_port-forward.md | 2 +- docs/en/cli/vela_rollout.md | 6 +++--- docs/en/cli/vela_route.md | 2 +- docs/en/cli/vela_scaler.md | 12 ++++++------ docs/en/cli/vela_show.md | 2 +- docs/en/cli/vela_status.md | 2 +- docs/en/cli/vela_svc.md | 2 +- docs/en/cli/vela_svc_deploy.md | 2 +- docs/en/cli/vela_system.md | 2 +- docs/en/cli/vela_system_info.md | 2 +- docs/en/cli/vela_template.md | 2 +- docs/en/cli/vela_template_context.md | 2 +- docs/en/cli/vela_traits.md | 2 +- docs/en/cli/vela_up.md | 2 +- docs/en/cli/vela_version.md | 2 +- docs/en/cli/vela_workloads.md | 2 +- docs/en/developers/alternative-cmd.md | 14 +++++++------- docs/en/developers/references/traits/metrics.md | 2 +- docs/en/developers/references/traits/rollout.md | 12 ++++++------ docs/en/developers/references/traits/scale.md | 2 +- docs/en/developers/set-metrics.md | 6 +++--- docs/en/developers/set-rollout.md | 8 ++++---- docs/examples/testapp/vela.yaml | 2 +- e2e/commonContext.go | 2 +- hack/vela-templates/cue/manualscale.cue | 4 ++-- hack/vela-templates/cue/metrics.cue | 2 +- hack/vela-templates/cue/rollout.cue | 8 ++++---- hack/vela-templates/definitions/metrics.yaml | 2 +- pkg/commands/refresh.go | 5 +++-- pkg/commands/trait.go | 3 ++- pkg/commands/traits.go | 1 - pkg/commands/workloads.go | 1 - pkg/cue/testdata/traits/manualscaler.cue | 4 ++-- pkg/oam/trait_checker.go | 4 +--- pkg/plugins/testdata/manualscalars.yaml | 4 ++-- 73 files changed, 133 insertions(+), 130 deletions(-) rename docs/en/cli/{vela_metric.md => vela_metrics.md} (69%) diff --git a/charts/vela-core/templates/defwithtemplate/manualscale.yaml b/charts/vela-core/templates/defwithtemplate/manualscale.yaml index 4a7f73c7b..694b77f63 100644 --- a/charts/vela-core/templates/defwithtemplate/manualscale.yaml +++ b/charts/vela-core/templates/defwithtemplate/manualscale.yaml @@ -17,11 +17,11 @@ spec: apiVersion: "core.oam.dev/v1alpha2" kind: "ManualScalerTrait" spec: { - replicaCount: parameter.replica + replicaCount: parameter.replicas } } parameter: { //+short=r - replica: *1 | int + replicas: *1 | int } diff --git a/charts/vela-core/templates/defwithtemplate/metrics.yaml b/charts/vela-core/templates/defwithtemplate/metrics.yaml index a5a2ea22d..183f79556 100644 --- a/charts/vela-core/templates/defwithtemplate/metrics.yaml +++ b/charts/vela-core/templates/defwithtemplate/metrics.yaml @@ -1,7 +1,7 @@ apiVersion: core.oam.dev/v1alpha2 kind: TraitDefinition metadata: - name: metric + name: metrics annotations: definition.oam.dev/description: "Configure metrics targets to be monitored for the app" spec: @@ -25,7 +25,7 @@ spec: // +usage=format of the metrics, default as prometheus // +short=f format: *"prometheus" | string - // +usage= the metric path of the service + // +usage= the metrics path of the service path: *"/metrics" | string scheme: *"http" | string enabled: *true | bool diff --git a/charts/vela-core/templates/defwithtemplate/rollout.yaml b/charts/vela-core/templates/defwithtemplate/rollout.yaml index fb8ac73db..9843c905f 100644 --- a/charts/vela-core/templates/defwithtemplate/rollout.yaml +++ b/charts/vela-core/templates/defwithtemplate/rollout.yaml @@ -36,16 +36,16 @@ spec: // percentage (0-100) stepWeight: parameter.stepWeight // max replicas scale up to canary - maxReplicas: parameter.replica + maxReplicas: parameter.replicas } } } parameter: { - // +usage=total replica of the workload - replica: *5 | int + // +usage=total replicas of the workload + replicas: *2 | int // +alias=step-weight // +usage=weight percent of every step in rolling update - stepWeight: *20 | int + stepWeight: *50 | int interval: *"30s" | string } diff --git a/design/api/vela-restful-api-reference.md b/design/api/vela-restful-api-reference.md index 595779dfd..860ab1efa 100644 --- a/design/api/vela-restful-api-reference.md +++ b/design/api/vela-restful-api-reference.md @@ -426,7 +426,7 @@ Please also specify `traits` values if need to attach a trait to several traits "workload_name": "poc5", "flags": [ { - "name": "replica", + "name": "replicas", "value": "4" } ] @@ -534,7 +534,7 @@ sample request "name": "scale", "flags": [ { - "name": "replica", + "name": "replicas", "value": "4" } ] @@ -556,9 +556,9 @@ sample response "data": { "name": "manualscaler", "type": "trait", - "template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ManualScalerTrait\"\n\tspec: {\n\t\treplicaCount: manualscaler.replica\n\t}\n}\nmanualscaler: {\n\t//+short=r\n\treplica: *2 | int\n}\n", + "template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ManualScalerTrait\"\n\tspec: {\n\t\treplicaCount: manualscaler.replicas\n\t}\n}\nmanualscaler: {\n\t//+short=r\n\treplicas: *2 | int\n}\n", "parameters": [{ - "name": "replica", + "name": "replicas", "short": "r", "default": 2, "type": 4 @@ -702,9 +702,9 @@ sample response },{ "name": "rollout", "type": "trait", - "template": "#Template: {\n\tapiVersion: \"extend.oam.dev/v1alpha2\"\n\tkind: \"SimpleRolloutTrait\"\n\tspec: {\n\t\treplica: rollout.replica\n\t\tmaxUnavailable: rollout.maxUnavailable\n\t\tbatch: rollout.batch\n\t}\n}\nrollout: {\n\treplica: *3 | int\n\tmaxUnavailable: *1 | int\n\tbatch: *2 | int\n}\n", + "template": "#Template: {\n\tapiVersion: \"extend.oam.dev/v1alpha2\"\n\tkind: \"SimpleRolloutTrait\"\n\tspec: {\n\t\treplicas: rollout.replicas\n\t\tmaxUnavailable: rollout.maxUnavailable\n\t\tbatch: rollout.batch\n\t}\n}\nrollout: {\n\treplicas: *3 | int\n\tmaxUnavailable: *1 | int\n\tbatch: *2 | int\n}\n", "parameters": [{ - "name": "replica", + "name": "replicas", "default": 3, "type": 4 }, { diff --git a/design/vela-core/appfile-design.md b/design/vela-core/appfile-design.md index 703b3aa27..4990e7e21 100644 --- a/design/vela-core/appfile-design.md +++ b/design/vela-core/appfile-design.md @@ -50,14 +50,14 @@ services: - /mnt/path=sec:my-secret scale: - replica: 2 + replicas: 2 auto: # automatic scale up and down based on given metrics range: "1-10" cpu: 80 # if cpu utilization is above 80%, scale up qps: 1000 # if qps is higher than 1k, scale up canary: # Auto-create canary deployment. Only upgrade after verify successfully. - replica: 1 # canary deployment size + replicas: 1 # canary deployment size headers: - "foo:bar.*" ``` diff --git a/docs/_sidebar.md b/docs/_sidebar.md index fe07d5df7..d2da9a6ef 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -66,7 +66,7 @@ - [vela route](/en/cli/vela_route.md) - [vela autoscale](/en/cli/vela_autoscale.md) - [vela rollout](/en/cli/vela_rollout.md) - - [vela metric](/en/cli/vela_metric.md) + - [vela metrics](/en/cli/vela_metric.md) - System - [vela completion](/en/cli/vela_completion.md) - [vela dashboard](/en/cli/vela_dashboard.md) diff --git a/docs/en/cli/vela.md b/docs/en/cli/vela.md index efda13bed..043648d76 100644 --- a/docs/en/cli/vela.md +++ b/docs/en/cli/vela.md @@ -19,6 +19,7 @@ vela [flags] ### SEE ALSO +* [vela autoscale](vela_autoscale.md) - Attach autoscale trait to an app * [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities * [vela completion](vela_completion.md) - Output shell completion code for the specified shell (bash or zsh) * [vela config](vela_config.md) - Manage configurations @@ -30,7 +31,11 @@ vela [flags] * [vela install](vela_install.md) - Install Vela Core with built-in capabilities * [vela logs](vela_logs.md) - Tail logs for application * [vela ls](vela_ls.md) - List services +* [vela metrics](vela_metrics.md) - Attach metrics trait to an app * [vela port-forward](vela_port-forward.md) - Forward local ports to services in an application +* [vela rollout](vela_rollout.md) - Attach rollout trait to an app +* [vela route](vela_route.md) - Attach route trait to an app +* [vela scaler](vela_scaler.md) - Attach scaler trait to an app * [vela show](vela_show.md) - Show details of an application * [vela status](vela_status.md) - Show status of an application * [vela svc](vela_svc.md) - Manage services @@ -41,4 +46,4 @@ vela [flags] * [vela version](vela_version.md) - Prints out build version information * [vela workloads](vela_workloads.md) - List workloads -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_autoscale.md b/docs/en/cli/vela_autoscale.md index dfc7421e6..3b293166c 100644 --- a/docs/en/cli/vela_autoscale.md +++ b/docs/en/cli/vela_autoscale.md @@ -19,13 +19,13 @@ vela autoscale frontend ### Options ``` - --cpuPercent int specify the value for CPU utilization, like 80, which means 80% - --detach detach trait from service - -h, --help help for autoscale - --max int maximal replicas of the workload - --min int minimal replicas of the workload - -s, --staging only save changes locally without real update application - --svc string specify one service belonging to the application + --cpu-percent int specify the value for CPU utilization, like 80, which means 80% + --detach detach trait from service + -h, --help help for autoscale + --max int maximal replicas of the workload + --min int minimal replicas of the workload + -s, --staging only save changes locally without real update application + --svc string specify one service belonging to the application ``` ### Options inherited from parent commands @@ -38,4 +38,4 @@ vela autoscale frontend * [vela](vela.md) - -###### Auto generated by spf13/cobra on 12-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_cap.md b/docs/en/cli/vela_cap.md index 7221063a0..58c5b56a1 100644 --- a/docs/en/cli/vela_cap.md +++ b/docs/en/cli/vela_cap.md @@ -26,4 +26,4 @@ Manage capability centers and installing/uninstalling capabilities * [vela cap ls](vela_cap_ls.md) - List capabilities from cap-center * [vela cap uninstall](vela_cap_uninstall.md) - Uninstall capability from cluster -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_cap_center.md b/docs/en/cli/vela_cap_center.md index e749cd00a..31af9cf38 100644 --- a/docs/en/cli/vela_cap_center.md +++ b/docs/en/cli/vela_cap_center.md @@ -26,4 +26,4 @@ Manage Capability Center with config, sync, list * [vela cap center remove](vela_cap_center_remove.md) - Remove specified capability center * [vela cap center sync](vela_cap_center_sync.md) - Sync capabilities from remote center, default to sync all centers -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_cap_center_config.md b/docs/en/cli/vela_cap_center_config.md index 1f64d3e9a..f9ad338aa 100644 --- a/docs/en/cli/vela_cap_center_config.md +++ b/docs/en/cli/vela_cap_center_config.md @@ -33,4 +33,4 @@ vela cap center config mycenter https://github.com/oam-dev/catalog/cap-center * [vela cap center](vela_cap_center.md) - Manage Capability Center -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_cap_center_ls.md b/docs/en/cli/vela_cap_center_ls.md index e6858721b..52ae6a5dc 100644 --- a/docs/en/cli/vela_cap_center_ls.md +++ b/docs/en/cli/vela_cap_center_ls.md @@ -32,4 +32,4 @@ vela cap center ls * [vela cap center](vela_cap_center.md) - Manage Capability Center -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_cap_center_remove.md b/docs/en/cli/vela_cap_center_remove.md index d1413c67a..4583b78d7 100644 --- a/docs/en/cli/vela_cap_center_remove.md +++ b/docs/en/cli/vela_cap_center_remove.md @@ -32,4 +32,4 @@ vela cap center remove mycenter * [vela cap center](vela_cap_center.md) - Manage Capability Center -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_cap_center_sync.md b/docs/en/cli/vela_cap_center_sync.md index 5b467b943..3bc4d6c18 100644 --- a/docs/en/cli/vela_cap_center_sync.md +++ b/docs/en/cli/vela_cap_center_sync.md @@ -32,4 +32,4 @@ vela cap center sync mycenter * [vela cap center](vela_cap_center.md) - Manage Capability Center -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_cap_install.md b/docs/en/cli/vela_cap_install.md index 810bc4128..bc919054c 100644 --- a/docs/en/cli/vela_cap_install.md +++ b/docs/en/cli/vela_cap_install.md @@ -33,4 +33,4 @@ vela cap install mycenter/route * [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_cap_ls.md b/docs/en/cli/vela_cap_ls.md index fdd0c43b9..af4c80240 100644 --- a/docs/en/cli/vela_cap_ls.md +++ b/docs/en/cli/vela_cap_ls.md @@ -32,4 +32,4 @@ vela cap ls * [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_cap_uninstall.md b/docs/en/cli/vela_cap_uninstall.md index b93ef3dda..28fb3bacb 100644 --- a/docs/en/cli/vela_cap_uninstall.md +++ b/docs/en/cli/vela_cap_uninstall.md @@ -33,4 +33,4 @@ vela cap uninstall route * [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_completion.md b/docs/en/cli/vela_completion.md index 6da7c0f59..045b382e9 100644 --- a/docs/en/cli/vela_completion.md +++ b/docs/en/cli/vela_completion.md @@ -27,4 +27,4 @@ of vela commands. * [vela completion bash](vela_completion_bash.md) - generate autocompletions script for bash * [vela completion zsh](vela_completion_zsh.md) - generate autocompletions script for zsh -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_completion_bash.md b/docs/en/cli/vela_completion_bash.md index e0116afc5..1ac8dd76e 100644 --- a/docs/en/cli/vela_completion_bash.md +++ b/docs/en/cli/vela_completion_bash.md @@ -36,4 +36,4 @@ vela completion bash * [vela completion](vela_completion.md) - Output shell completion code for the specified shell (bash or zsh) -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_completion_zsh.md b/docs/en/cli/vela_completion_zsh.md index f2947ca07..c3c68f6fd 100644 --- a/docs/en/cli/vela_completion_zsh.md +++ b/docs/en/cli/vela_completion_zsh.md @@ -33,4 +33,4 @@ vela completion zsh * [vela completion](vela_completion.md) - Output shell completion code for the specified shell (bash or zsh) -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_config.md b/docs/en/cli/vela_config.md index d79c8c336..1d1dbce3e 100644 --- a/docs/en/cli/vela_config.md +++ b/docs/en/cli/vela_config.md @@ -26,4 +26,4 @@ Manage configurations * [vela config ls](vela_config_ls.md) - List configs * [vela config set](vela_config_set.md) - Set data for a config -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_config_del.md b/docs/en/cli/vela_config_del.md index 8e7ea3eac..cf7b49513 100644 --- a/docs/en/cli/vela_config_del.md +++ b/docs/en/cli/vela_config_del.md @@ -32,4 +32,4 @@ vela config del * [vela config](vela_config.md) - Manage configurations -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_config_get.md b/docs/en/cli/vela_config_get.md index b20663718..26a547690 100644 --- a/docs/en/cli/vela_config_get.md +++ b/docs/en/cli/vela_config_get.md @@ -32,4 +32,4 @@ vela config get * [vela config](vela_config.md) - Manage configurations -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_config_ls.md b/docs/en/cli/vela_config_ls.md index 591a8aef1..e909f716b 100644 --- a/docs/en/cli/vela_config_ls.md +++ b/docs/en/cli/vela_config_ls.md @@ -32,4 +32,4 @@ vela config ls * [vela config](vela_config.md) - Manage configurations -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_config_set.md b/docs/en/cli/vela_config_set.md index 53dfabf28..a34ca5eb0 100644 --- a/docs/en/cli/vela_config_set.md +++ b/docs/en/cli/vela_config_set.md @@ -32,4 +32,4 @@ vela config set KEY=VALUE K2=V2 * [vela config](vela_config.md) - Manage configurations -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_dashboard.md b/docs/en/cli/vela_dashboard.md index 20a1b0d01..4df76b09e 100644 --- a/docs/en/cli/vela_dashboard.md +++ b/docs/en/cli/vela_dashboard.md @@ -38,4 +38,4 @@ dashboard * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_delete.md b/docs/en/cli/vela_delete.md index 4663db756..2278bd579 100644 --- a/docs/en/cli/vela_delete.md +++ b/docs/en/cli/vela_delete.md @@ -33,4 +33,4 @@ vela delete frontend * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_env.md b/docs/en/cli/vela_env.md index 59d578d81..d27407b14 100644 --- a/docs/en/cli/vela_env.md +++ b/docs/en/cli/vela_env.md @@ -26,4 +26,4 @@ Manage environments * [vela env ls](vela_env_ls.md) - List environments * [vela env set](vela_env_set.md) - Set an environment -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_env_delete.md b/docs/en/cli/vela_env_delete.md index 12c3fdb3f..70f8480b3 100644 --- a/docs/en/cli/vela_env_delete.md +++ b/docs/en/cli/vela_env_delete.md @@ -32,4 +32,4 @@ vela env delete test * [vela env](vela_env.md) - Manage environments -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_env_init.md b/docs/en/cli/vela_env_init.md index 692ec964d..61ca7f63e 100644 --- a/docs/en/cli/vela_env_init.md +++ b/docs/en/cli/vela_env_init.md @@ -36,4 +36,4 @@ vela env init test --namespace test --email my@email.com * [vela env](vela_env.md) - Manage environments -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_env_ls.md b/docs/en/cli/vela_env_ls.md index 14ecb29e6..4f72cdc8e 100644 --- a/docs/en/cli/vela_env_ls.md +++ b/docs/en/cli/vela_env_ls.md @@ -32,4 +32,4 @@ vela env ls [env-name] * [vela env](vela_env.md) - Manage environments -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_env_set.md b/docs/en/cli/vela_env_set.md index 3cb008a81..beecf4b2d 100644 --- a/docs/en/cli/vela_env_set.md +++ b/docs/en/cli/vela_env_set.md @@ -32,4 +32,4 @@ vela env set test * [vela env](vela_env.md) - Manage environments -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_exec.md b/docs/en/cli/vela_exec.md index 538c50a38..d004afc3e 100644 --- a/docs/en/cli/vela_exec.md +++ b/docs/en/cli/vela_exec.md @@ -29,4 +29,4 @@ vela exec [flags] APP_NAME -- COMMAND [args...] * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_init.md b/docs/en/cli/vela_init.md index 23febc874..522f2733e 100644 --- a/docs/en/cli/vela_init.md +++ b/docs/en/cli/vela_init.md @@ -33,4 +33,4 @@ vela init * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_install.md b/docs/en/cli/vela_install.md index adc2f2085..0464988d7 100644 --- a/docs/en/cli/vela_install.md +++ b/docs/en/cli/vela_install.md @@ -31,4 +31,4 @@ vela install [flags] * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_logs.md b/docs/en/cli/vela_logs.md index 86f7503a8..042af30b4 100644 --- a/docs/en/cli/vela_logs.md +++ b/docs/en/cli/vela_logs.md @@ -27,4 +27,4 @@ vela logs [flags] * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_ls.md b/docs/en/cli/vela_ls.md index 0985b8c99..f395e48da 100644 --- a/docs/en/cli/vela_ls.md +++ b/docs/en/cli/vela_ls.md @@ -33,4 +33,4 @@ vela ls * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_metric.md b/docs/en/cli/vela_metrics.md similarity index 69% rename from docs/en/cli/vela_metric.md rename to docs/en/cli/vela_metrics.md index 8e510bf1c..10808b3f6 100644 --- a/docs/en/cli/vela_metric.md +++ b/docs/en/cli/vela_metrics.md @@ -1,19 +1,19 @@ -## vela metric +## vela metrics -Attach metric trait to an app +Attach metrics trait to an app ### Synopsis -Attach metric trait to an app +Attach metrics trait to an app ``` -vela metric [args] +vela metrics [args] ``` ### Examples ``` -vela metric frontend +vela metrics frontend ``` ### Options @@ -22,8 +22,8 @@ vela metric frontend --detach detach trait from service --enabled (default true) -f, --format string format of the metrics, default as prometheus (default "prometheus") - -h, --help help for metric - --path string the metric path of the service (default "/metrics") + -h, --help help for metrics + --path string the metrics path of the service (default "/metrics") --port int the port for metrics, will discovery automatically by default --scheme string (default "http") -s, --staging only save changes locally without real update application @@ -40,4 +40,4 @@ vela metric frontend * [vela](vela.md) - -###### Auto generated by spf13/cobra on 12-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_port-forward.md b/docs/en/cli/vela_port-forward.md index 633896ff4..9030d361c 100644 --- a/docs/en/cli/vela_port-forward.md +++ b/docs/en/cli/vela_port-forward.md @@ -29,4 +29,4 @@ vela port-forward APP_NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N: * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_rollout.md b/docs/en/cli/vela_rollout.md index 1339b51c2..1e3a13873 100644 --- a/docs/en/cli/vela_rollout.md +++ b/docs/en/cli/vela_rollout.md @@ -22,9 +22,9 @@ vela rollout frontend --detach detach trait from service -h, --help help for rollout --interval string (default "30s") - --replica int total replica of the workload (default 5) + --replicas int total replicas of the workload (default 2) -s, --staging only save changes locally without real update application - --step-weight int weight percent of every step in rolling update (default 20) + --step-weight int weight percent of every step in rolling update (default 50) --svc string specify one service belonging to the application ``` @@ -38,4 +38,4 @@ vela rollout frontend * [vela](vela.md) - -###### Auto generated by spf13/cobra on 12-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_route.md b/docs/en/cli/vela_route.md index 6fea05fe7..fba4320ed 100644 --- a/docs/en/cli/vela_route.md +++ b/docs/en/cli/vela_route.md @@ -37,4 +37,4 @@ vela route frontend * [vela](vela.md) - -###### Auto generated by spf13/cobra on 12-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_scaler.md b/docs/en/cli/vela_scaler.md index 86d3beb4c..170387464 100644 --- a/docs/en/cli/vela_scaler.md +++ b/docs/en/cli/vela_scaler.md @@ -19,11 +19,11 @@ vela scaler frontend ### Options ``` - --detach detach trait from service - -h, --help help for scaler - -r, --replica int (default 1) - -s, --staging only save changes locally without real update application - --svc string specify one service belonging to the application + --detach detach trait from service + -h, --help help for scaler + -r, --replicas int (default 1) + -s, --staging only save changes locally without real update application + --svc string specify one service belonging to the application ``` ### Options inherited from parent commands @@ -36,4 +36,4 @@ vela scaler frontend * [vela](vela.md) - -###### Auto generated by spf13/cobra on 12-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_show.md b/docs/en/cli/vela_show.md index 6857c9a3f..2cd44e6e1 100644 --- a/docs/en/cli/vela_show.md +++ b/docs/en/cli/vela_show.md @@ -33,4 +33,4 @@ vela show APP_NAME * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_status.md b/docs/en/cli/vela_status.md index d0bab0f18..faf1e9a00 100644 --- a/docs/en/cli/vela_status.md +++ b/docs/en/cli/vela_status.md @@ -33,4 +33,4 @@ vela status APP_NAME * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_svc.md b/docs/en/cli/vela_svc.md index 0c648c0f0..02fcdb346 100644 --- a/docs/en/cli/vela_svc.md +++ b/docs/en/cli/vela_svc.md @@ -24,4 +24,4 @@ Manage services * [vela](vela.md) - * [vela svc deploy](vela_svc_deploy.md) - Initialize and run a service -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_svc_deploy.md b/docs/en/cli/vela_svc_deploy.md index 55db71f06..1e2910a81 100644 --- a/docs/en/cli/vela_svc_deploy.md +++ b/docs/en/cli/vela_svc_deploy.md @@ -35,4 +35,4 @@ vela svc deploy -t * [vela svc](vela_svc.md) - Manage services -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_system.md b/docs/en/cli/vela_system.md index acb9e3762..7d120f188 100644 --- a/docs/en/cli/vela_system.md +++ b/docs/en/cli/vela_system.md @@ -23,4 +23,4 @@ System management utilities * [vela](vela.md) - * [vela system info](vela_system_info.md) - Show vela client and cluster chartPath -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_system_info.md b/docs/en/cli/vela_system_info.md index 9ce44d55a..4d194a029 100644 --- a/docs/en/cli/vela_system_info.md +++ b/docs/en/cli/vela_system_info.md @@ -26,4 +26,4 @@ vela system info [flags] * [vela system](vela_system.md) - System management utilities -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_template.md b/docs/en/cli/vela_template.md index b8318f34a..f505c23c5 100644 --- a/docs/en/cli/vela_template.md +++ b/docs/en/cli/vela_template.md @@ -23,4 +23,4 @@ Manage templates * [vela](vela.md) - * [vela template context](vela_template_context.md) - Show context parameters -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_template_context.md b/docs/en/cli/vela_template_context.md index 9badbb881..e99109362 100644 --- a/docs/en/cli/vela_template_context.md +++ b/docs/en/cli/vela_template_context.md @@ -32,4 +32,4 @@ vela template context * [vela template](vela_template.md) - Manage templates -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_traits.md b/docs/en/cli/vela_traits.md index 98c6897b5..e3c0d97c1 100644 --- a/docs/en/cli/vela_traits.md +++ b/docs/en/cli/vela_traits.md @@ -34,4 +34,4 @@ vela traits * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_up.md b/docs/en/cli/vela_up.md index 8bcc675c4..872ba6c82 100644 --- a/docs/en/cli/vela_up.md +++ b/docs/en/cli/vela_up.md @@ -27,4 +27,4 @@ vela up * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_version.md b/docs/en/cli/vela_version.md index 0d19aa23d..f2edc0db7 100644 --- a/docs/en/cli/vela_version.md +++ b/docs/en/cli/vela_version.md @@ -26,4 +26,4 @@ vela version [flags] * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/cli/vela_workloads.md b/docs/en/cli/vela_workloads.md index fe9083e25..91666ebef 100644 --- a/docs/en/cli/vela_workloads.md +++ b/docs/en/cli/vela_workloads.md @@ -33,4 +33,4 @@ vela workloads * [vela](vela.md) - -###### Auto generated by spf13/cobra on 13-Nov-2020 +###### Auto generated by spf13/cobra on 16-Nov-2020 diff --git a/docs/en/developers/alternative-cmd.md b/docs/en/developers/alternative-cmd.md index d2f3a40fb..de886f651 100644 --- a/docs/en/developers/alternative-cmd.md +++ b/docs/en/developers/alternative-cmd.md @@ -179,12 +179,12 @@ please refer to [autoscale in Appfile](/en/developers/set-autoscale.md). With more and more requests to the application, the replicas gradually increase from one to four. -## `vela metric` +## `vela metrics` A shortcut to add metrics config. If your application has exposed metrics, you can easily setup monitoring system -with the help of `metric` capability. +with the help of `metrics` capability. Let's run [`christianhxc/gorandom:1.0`](https://github.com/christianhxc/prometheus-tutorial) as an example app. The app will emit random latencies as metrics. @@ -193,18 +193,18 @@ The app will emit random latencies as metrics. $ vela svc deploy metricapp -t webservice --image christianhxc/gorandom:1.0 --port 8080 ``` -Then add metric by: +Then add metrics by: ```bash -$ vela metric metricapp -Adding metric for app metricapp +$ vela metrics metricapp +Adding metrics for app metricapp ⠋ Deploying ... ✅ Application Deployed Successfully! - Name: metricapp Type: webservice HEALTHY Ready: 1/1 Routes: - - ✅ metric: Monitoring port: 8080, path: /metrics, format: prometheus, schema: http. + - ✅ metrics: Monitoring port: 8080, path: /metrics, format: prometheus, schema: http. Last Deployment: Created at: 2020-11-02 14:31:56 +0800 CST Updated at: 2020-11-02T14:32:00+08:00 @@ -261,7 +261,7 @@ Hello World% Secondly, add rollout policy for your app: ```shell script -$ vela rollout testapp --replica 5 --step-weight 20 --interval 5s +$ vela rollout testapp --replicas 5 --step-weight 20 --interval 5s ``` Then update your app by: diff --git a/docs/en/developers/references/traits/metrics.md b/docs/en/developers/references/traits/metrics.md index 41d4a486f..d717e855f 100644 --- a/docs/en/developers/references/traits/metrics.md +++ b/docs/en/developers/references/traits/metrics.md @@ -26,7 +26,7 @@ services: Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Path** | **string** | the metric path of the service | [default to /metrics] +**Path** | **string** | the metrics path of the service | [default to /metrics] **Format** | **string** | +format of the metrics, default as prometheus | [default to prometheus] **Scheme** | **string** | | [default to http] **Enabled** | **bool** | | [default to true] diff --git a/docs/en/developers/references/traits/rollout.md b/docs/en/developers/references/traits/rollout.md index 89f3d02f2..ecd4f4f9e 100644 --- a/docs/en/developers/references/traits/rollout.md +++ b/docs/en/developers/references/traits/rollout.md @@ -8,7 +8,7 @@ ### `Autoscale` -When `Rollout` and `Autoscle` traits are attached to the same service, they two will fight over the number of instances during rollout. Thus, it's by design that `Rollout` will take over replicas control (specified by `.replica` field) during rollout. +When `Rollout` and `Autoscle` traits are attached to the same service, they two will fight over the number of instances during rollout. Thus, it's by design that `Rollout` will take over replicas control (specified by `.replicas` field) during rollout. > Note: in up coming releases, KubeVela will introduce a separate section in Appfile to define release phase configurations such as `Rollout`. @@ -22,8 +22,8 @@ servcies: ... rollout: - replica: 2 - stepWeight: 5 + replicas: 2 + stepWeight: 50 interval: "10s" ``` @@ -31,8 +31,8 @@ servcies: Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**replica** | **string** | replica number of the service instance per revision | [ default to 5 ] -**stepWeight** | **string** | canary increment step percentage (0-100)| [default to 20 ] +**replicas** | **string** | replicas number of the service instance per revision | [ default to 2 ] +**stepWeight** | **string** | canary increment step percentage (0-100)| [default to 50 ] **interval** | **string** | wait interval for every rolling update step | [default to '30s'] ## How `Rollout` works? @@ -44,7 +44,7 @@ In detail, `Rollout` controller will create a canary of your app , and then grad ![alt](../../../../resources/traffic-shifting-analysis.png) -In this sample, for every `10s`, `5%` traffic will be shifted to canary from the primary, until the traffic on canary reached `50%`. At the mean time, the instance number of canary will automatically scale to `replica: 2` per configured in Appfile. +In this sample, for every `10s`, `5%` traffic will be shifted to canary from the primary, until the traffic on canary reached `50%`. At the mean time, the instance number of canary will automatically scale to `replicas: 2` per configured in Appfile. Based on analysis result of the KPIs during this traffic shifting, a canary will be promoted or aborted if analysis is failed. If promoting, the primary will be upgraded from v1 to v2, and traffic will be fully shifted back to the primary instances. So as result, canary instances will be deleted after the promotion finished. diff --git a/docs/en/developers/references/traits/scale.md b/docs/en/developers/references/traits/scale.md index 7c9e887ca..02fe2266f 100644 --- a/docs/en/developers/references/traits/scale.md +++ b/docs/en/developers/references/traits/scale.md @@ -15,7 +15,7 @@ services: my-service-name: ... scaler: - replica: 100 + replicas: 100 ``` ## Properties diff --git a/docs/en/developers/set-metrics.md b/docs/en/developers/set-metrics.md index fa6c177cc..07cd1bd43 100644 --- a/docs/en/developers/set-metrics.md +++ b/docs/en/developers/set-metrics.md @@ -1,6 +1,6 @@ # Monitoring Application -If your application has exposed metrics, you can easily tell the platform how to collect the metrics data from your app with `metric` capability. +If your application has exposed metrics, you can easily tell the platform how to collect the metrics data from your app with `metrics` capability. Let's run [`christianhxc/gorandom:1.0`](https://github.com/christianhxc/prometheus-tutorial) as an example app. The app will emit random latencies as metrics. @@ -17,7 +17,7 @@ The app will emit random latencies as metrics. image: christianhxc/gorandom:1.0 port: 8080 - metric: + metrics: enabled: true format: prometheus path: /metrics @@ -49,7 +49,7 @@ The app will emit random latencies as metrics. Type: webservice HEALTHY Ready: 1/1 Traits: - - ✅ metric: Monitoring port: 8080, path: /metrics, format: prometheus, schema: http. + - ✅ metrics: Monitoring port: 8080, path: /metrics, format: prometheus, schema: http. Last Deployment: Created at: 2020-11-11 17:00:59 -0800 PST Updated at: 2020-11-11T17:01:06-08:00 diff --git a/docs/en/developers/set-rollout.md b/docs/en/developers/set-rollout.md index d9e29a159..8c1644692 100644 --- a/docs/en/developers/set-rollout.md +++ b/docs/en/developers/set-rollout.md @@ -13,7 +13,7 @@ services: port: 80 rollout: - replica: 5 + replicas: 5 stepWeight: 20 interval: "30s" @@ -47,7 +47,7 @@ Services: HEALTHY Ready: 5/5 Traits: - ✅ rollout: interval=5s - replica=5 + replicas=5 stepWeight=20 - ✅ route: Visiting URL: http://example.com IP: @@ -76,7 +76,7 @@ services: + image: oamdev/testapp:rolling02 port: 80 rollout: - replica: 5 + replicas: 5 stepWeight: 20 interval: "30s" route: @@ -107,7 +107,7 @@ Services: HEALTHY express-server-v2:Ready: 1/1 express-server-v1:Ready: 4/4 Traits: - ✅ rollout: interval=30s - replica=5 + replicas=5 stepWeight=20 - ✅ route: Visiting by using 'vela port-forward testapp --route' diff --git a/docs/examples/testapp/vela.yaml b/docs/examples/testapp/vela.yaml index a1a813a89..31e53daec 100644 --- a/docs/examples/testapp/vela.yaml +++ b/docs/examples/testapp/vela.yaml @@ -21,7 +21,7 @@ services: port: 8080 # scaler: - # replica: 1 + # replicas: 1 # route: # domain: example.com diff --git a/e2e/commonContext.go b/e2e/commonContext.go index 77f38c1d5..fd818b0ee 100644 --- a/e2e/commonContext.go +++ b/e2e/commonContext.go @@ -142,7 +142,7 @@ var ( ginkgo.It("should sync capabilities from cluster before listing trait capabilities", func() { output, err := Exec("vela traits") gomega.Expect(err).NotTo(gomega.HaveOccurred()) - gomega.Expect(output).To(gomega.ContainSubstring("metric")) + gomega.Expect(output).To(gomega.ContainSubstring("metrics")) gomega.Expect(output).To(gomega.ContainSubstring("rollout")) gomega.Expect(output).To(gomega.ContainSubstring("route")) }) diff --git a/hack/vela-templates/cue/manualscale.cue b/hack/vela-templates/cue/manualscale.cue index 2f8b6c98a..452ec5f0d 100644 --- a/hack/vela-templates/cue/manualscale.cue +++ b/hack/vela-templates/cue/manualscale.cue @@ -2,10 +2,10 @@ output: { apiVersion: "core.oam.dev/v1alpha2" kind: "ManualScalerTrait" spec: { - replicaCount: parameter.replica + replicaCount: parameter.replicas } } parameter: { //+short=r - replica: *1 | int + replicas: *1 | int } diff --git a/hack/vela-templates/cue/metrics.cue b/hack/vela-templates/cue/metrics.cue index 6911faf1b..17d4e59a2 100644 --- a/hack/vela-templates/cue/metrics.cue +++ b/hack/vela-templates/cue/metrics.cue @@ -9,7 +9,7 @@ parameter: { // +usage=format of the metrics, default as prometheus // +short=f format: *"prometheus" | string - // +usage= the metric path of the service + // +usage= the metrics path of the service path: *"/metrics" | string scheme: *"http" | string enabled: *true | bool diff --git a/hack/vela-templates/cue/rollout.cue b/hack/vela-templates/cue/rollout.cue index 472bd9ae9..dbc497f57 100644 --- a/hack/vela-templates/cue/rollout.cue +++ b/hack/vela-templates/cue/rollout.cue @@ -21,15 +21,15 @@ output: { // percentage (0-100) stepWeight: parameter.stepWeight // max replicas scale up to canary - maxReplicas: parameter.replica + maxReplicas: parameter.replicas } } } parameter: { - // +usage=total replica of the workload - replica: *5 | int + // +usage=total replicas of the workload + replicas: *2 | int // +alias=step-weight // +usage=weight percent of every step in rolling update - stepWeight: *20 | int + stepWeight: *50 | int interval: *"30s" | string } diff --git a/hack/vela-templates/definitions/metrics.yaml b/hack/vela-templates/definitions/metrics.yaml index 1c7a37d8f..d4196fc4f 100644 --- a/hack/vela-templates/definitions/metrics.yaml +++ b/hack/vela-templates/definitions/metrics.yaml @@ -1,7 +1,7 @@ apiVersion: core.oam.dev/v1alpha2 kind: TraitDefinition metadata: - name: metric + name: metrics annotations: definition.oam.dev/description: "Configure metrics targets to be monitored for the app" spec: diff --git a/pkg/commands/refresh.go b/pkg/commands/refresh.go index 71dfbc22c..6b97f93a8 100644 --- a/pkg/commands/refresh.go +++ b/pkg/commands/refresh.go @@ -78,13 +78,13 @@ func printRefreshReport(newCaps, oldCaps []types.Capability, io cmdutil.IOStream } } if !silent { - io.Infof("Automatically discover capabilities successfully %s(no changes)\n", emojiSucceed) + io.Infof("Automatically discover capabilities successfully %s(no changes)\n\n", emojiSucceed) io.Info(table.String()) } return } - io.Infof("Automatically discover capabilities successfully %sAdd(%s) Update(%s) Delete(%s)\n", + io.Infof("Automatically discover capabilities successfully %sAdd(%s) Update(%s) Delete(%s)\n\n", emojiSucceed, green.Sprint(len(report[added])), yellow.Sprint(len(report[updated])), @@ -94,6 +94,7 @@ func printRefreshReport(newCaps, oldCaps []types.Capability, io cmdutil.IOStream addStsRow(updated, report, table) addStsRow(deleted, report, table) io.Info(table.String()) + io.Info() } func addStsRow(sts refreshStatus, report map[refreshStatus][]types.Capability, t *uitable.Table) { diff --git a/pkg/commands/trait.go b/pkg/commands/trait.go index 878c37ea3..666e536e4 100644 --- a/pkg/commands/trait.go +++ b/pkg/commands/trait.go @@ -40,7 +40,8 @@ func AddTraitCommands(parentCmd *cobra.Command, c types.Args, ioStreams cmdutil. var name = tmp.Name pluginCmd := &cobra.Command{ - Hidden: true, + // We can't hide these command, if so, cli docs will also disappear from auto-gen + // Hidden: true, Use: name + " [args]", DisableFlagsInUseLine: true, Short: "Attach " + name + " trait to an app", diff --git a/pkg/commands/traits.go b/pkg/commands/traits.go index a57f29900..1906c6e10 100644 --- a/pkg/commands/traits.go +++ b/pkg/commands/traits.go @@ -44,7 +44,6 @@ func NewTraitsCommand(c types.Args, ioStreams cmdutil.IOStreams) *cobra.Command func printTraitList(workloadName *string, ioStreams cmdutil.IOStreams) error { table := uitable.New() table.Wrap = true - table.MaxColWidth = 60 traitDefinitionList, err := oam.ListTraitDefinitions(workloadName) if err != nil { return err diff --git a/pkg/commands/workloads.go b/pkg/commands/workloads.go index bc5a7df11..6d93b1cad 100644 --- a/pkg/commands/workloads.go +++ b/pkg/commands/workloads.go @@ -43,7 +43,6 @@ func NewWorkloadsCommand(c types.Args, ioStreams cmdutil.IOStreams) *cobra.Comma func printWorkloadList(workloadList []types.Capability, ioStreams cmdutil.IOStreams) error { table := uitable.New() - table.MaxColWidth = 60 table.AddRow("NAME", "DESCRIPTION") for _, r := range workloadList { table.AddRow(r.Name, r.Description) diff --git a/pkg/cue/testdata/traits/manualscaler.cue b/pkg/cue/testdata/traits/manualscaler.cue index e7f31e8e2..59f5af545 100644 --- a/pkg/cue/testdata/traits/manualscaler.cue +++ b/pkg/cue/testdata/traits/manualscaler.cue @@ -2,10 +2,10 @@ output: { apiVersion: "core.oam.dev/v1alpha2" kind: "ManualScalerTrait" spec: { - replicaCount: parameter.replica + replicaCount: parameter.replicas } } parameter: { //+short=r - replica: *2 | int + replicas: *2 | int } diff --git a/pkg/oam/trait_checker.go b/pkg/oam/trait_checker.go index 7f0683df0..3726747ef 100644 --- a/pkg/oam/trait_checker.go +++ b/pkg/oam/trait_checker.go @@ -29,12 +29,10 @@ func GetChecker(traitType string, c client.Client) Checker { switch traitType { case "route": return &RouteChecker{c: c} - case "metric": + case "metrics": return &MetricChecker{c: c} case "autoscale": return &AutoscalerChecker{c: c} - case "cronscale": - return &AutoscalerChecker{c: c} } return &DefaultChecker{c: c} diff --git a/pkg/plugins/testdata/manualscalars.yaml b/pkg/plugins/testdata/manualscalars.yaml index 915b87088..6a4283aa5 100644 --- a/pkg/plugins/testdata/manualscalars.yaml +++ b/pkg/plugins/testdata/manualscalars.yaml @@ -16,10 +16,10 @@ spec: apiVersion: "core.oam.dev/v1alpha2" kind: "ManualScalerTrait" spec: { - replicaCount: parameter.replica + replicaCount: parameter.replicas } } parameter: { //+short=r - replica: *2 | int + replicas: *2 | int }