diff --git a/docs/en/cli/vela.md b/docs/en/cli/vela.md index 37c0ad47f..de697c225 100644 --- a/docs/en/cli/vela.md +++ b/docs/en/cli/vela.md @@ -15,7 +15,6 @@ 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 @@ -27,14 +26,9 @@ 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 show](vela_show.md) - Show the reference doc for a workload type or trait * [vela status](vela_status.md) - Show status of an application -* [vela svc](vela_svc.md) - Manage services * [vela system](vela_system.md) - System management utilities * [vela template](vela_template.md) - Manage templates * [vela traits](vela_traits.md) - List traits @@ -42,4 +36,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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_autoscale.md b/docs/en/cli/vela_autoscale.md deleted file mode 100644 index a7dd00d27..000000000 --- a/docs/en/cli/vela_autoscale.md +++ /dev/null @@ -1,41 +0,0 @@ -## vela autoscale - -Attach autoscale trait to an app - -### Synopsis - -Attach autoscale trait to an app - -``` -vela autoscale [args] -``` - -### Examples - -``` -vela autoscale frontend -``` - -### Options - -``` - --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 - -``` - -e, --env string specify environment name for application -``` - -### SEE ALSO - -* [vela](vela.md) - - -###### Auto generated by spf13/cobra on 9-Dec-2020 diff --git a/docs/en/cli/vela_cap.md b/docs/en/cli/vela_cap.md index c41df86c6..0f1a26fd9 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_cap_center.md b/docs/en/cli/vela_cap_center.md index cf19d436a..0e72a27f8 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_cap_center_config.md b/docs/en/cli/vela_cap_center_config.md index 94216901d..f5916bd90 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_cap_center_ls.md b/docs/en/cli/vela_cap_center_ls.md index 5f505ed20..5f659bf72 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_cap_center_remove.md b/docs/en/cli/vela_cap_center_remove.md index abaa98026..7bcab29f5 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_cap_center_sync.md b/docs/en/cli/vela_cap_center_sync.md index 852e3fe17..254bcb26f 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_cap_install.md b/docs/en/cli/vela_cap_install.md index fa960bccd..df25796ca 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_cap_ls.md b/docs/en/cli/vela_cap_ls.md index e401434f2..ed0d07307 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_cap_uninstall.md b/docs/en/cli/vela_cap_uninstall.md index e33dd4416..989822d38 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_completion.md b/docs/en/cli/vela_completion.md index c78bc88e8..13fc3437c 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_completion_bash.md b/docs/en/cli/vela_completion_bash.md index 0d2dfa67c..1d78adbd9 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_completion_zsh.md b/docs/en/cli/vela_completion_zsh.md index 6c5404167..27ed42f7d 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_config.md b/docs/en/cli/vela_config.md index 89f90e37b..184726496 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_config_del.md b/docs/en/cli/vela_config_del.md index 3fb4edbf5..8d5e87c4f 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_config_get.md b/docs/en/cli/vela_config_get.md index 4731233ae..0cda12f20 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_config_ls.md b/docs/en/cli/vela_config_ls.md index 3089bf352..cf8dde15f 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_config_set.md b/docs/en/cli/vela_config_set.md index 7f24b35bd..3c0d6fe20 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_delete.md b/docs/en/cli/vela_delete.md index 7c88a79da..aa83b3c3b 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_env.md b/docs/en/cli/vela_env.md index 483b991a5..be9f8ccc1 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_env_delete.md b/docs/en/cli/vela_env_delete.md index 5be28f1e6..947e0e23d 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_env_init.md b/docs/en/cli/vela_env_init.md index 6649c1697..46a4f411d 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_env_ls.md b/docs/en/cli/vela_env_ls.md index dad92aced..9a71f99c3 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_env_set.md b/docs/en/cli/vela_env_set.md index f6abdf4d5..dd45c663a 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_exec.md b/docs/en/cli/vela_exec.md index 9c655256a..5ee99602f 100644 --- a/docs/en/cli/vela_exec.md +++ b/docs/en/cli/vela_exec.md @@ -16,6 +16,7 @@ vela exec [flags] APP_NAME -- COMMAND [args...] -h, --help help for exec --pod-running-timeout duration The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running (default 1m0s) -i, --stdin Pass stdin to the container (default true) + -s, --svc string service name -t, --tty Stdin is a TTY (default true) ``` @@ -29,4 +30,4 @@ vela exec [flags] APP_NAME -- COMMAND [args...] * [vela](vela.md) - -###### Auto generated by spf13/cobra on 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_export.md b/docs/en/cli/vela_export.md index 5d31db722..7d6581db1 100644 --- a/docs/en/cli/vela_export.md +++ b/docs/en/cli/vela_export.md @@ -27,4 +27,4 @@ vela export * [vela](vela.md) - -###### Auto generated by spf13/cobra on 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_init.md b/docs/en/cli/vela_init.md index 0cdf84e36..e5807eabf 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_install.md b/docs/en/cli/vela_install.md index 0e8c56e98..c9fd582f2 100644 --- a/docs/en/cli/vela_install.md +++ b/docs/en/cli/vela_install.md @@ -17,6 +17,7 @@ vela install [flags] --image-pull-policy string vela core image pull policy, this will align to chart value image.pullPolicy --image-repo string vela core image repo, this will align to chart value image.repo --image-tag string vela core image repo, this will align to chart value image.tag + -s, --set strings arguments for installing vela-core chart -p, --vela-chart-path string path to vela core chart to override default chart -w, --wait string wait until vela-core is ready to serve, default will not wait (default "0s") ``` @@ -31,4 +32,4 @@ vela install [flags] * [vela](vela.md) - -###### Auto generated by spf13/cobra on 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_logs.md b/docs/en/cli/vela_logs.md index be7ff7d23..842792e0b 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_ls.md b/docs/en/cli/vela_ls.md index 8ff4fd03d..40d846ee0 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_metrics.md b/docs/en/cli/vela_metrics.md deleted file mode 100644 index f238fb93e..000000000 --- a/docs/en/cli/vela_metrics.md +++ /dev/null @@ -1,43 +0,0 @@ -## vela metrics - -Attach metrics trait to an app - -### Synopsis - -Attach metrics trait to an app - -``` -vela metrics [args] -``` - -### Examples - -``` -vela metrics frontend -``` - -### Options - -``` - --detach detach trait from service - --enabled (default true) - -f, --format string Format of the metrics, default as prometheus (default "prometheus") - -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 http The way to retrieve data which can take the values http or `https` (default "http") - -s, --staging only save changes locally without real update application - --svc string specify one service belonging to the application -``` - -### Options inherited from parent commands - -``` - -e, --env string specify environment name for application -``` - -### SEE ALSO - -* [vela](vela.md) - - -###### Auto generated by spf13/cobra on 9-Dec-2020 diff --git a/docs/en/cli/vela_port-forward.md b/docs/en/cli/vela_port-forward.md index b9dd389e8..cab6580c8 100644 --- a/docs/en/cli/vela_port-forward.md +++ b/docs/en/cli/vela_port-forward.md @@ -35,4 +35,4 @@ port-forward APP_NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMO * [vela](vela.md) - -###### Auto generated by spf13/cobra on 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_rollout.md b/docs/en/cli/vela_rollout.md deleted file mode 100644 index e86c79730..000000000 --- a/docs/en/cli/vela_rollout.md +++ /dev/null @@ -1,41 +0,0 @@ -## vela rollout - -Attach rollout trait to an app - -### Synopsis - -Attach rollout trait to an app - -``` -vela rollout [args] -``` - -### Examples - -``` -vela rollout frontend -``` - -### Options - -``` - --detach detach trait from service - -h, --help help for rollout - --interval string Schedule interval time (default "30s") - --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 50) - --svc string specify one service belonging to the application -``` - -### Options inherited from parent commands - -``` - -e, --env string specify environment name for application -``` - -### SEE ALSO - -* [vela](vela.md) - - -###### Auto generated by spf13/cobra on 9-Dec-2020 diff --git a/docs/en/cli/vela_route.md b/docs/en/cli/vela_route.md deleted file mode 100644 index f636d2bf2..000000000 --- a/docs/en/cli/vela_route.md +++ /dev/null @@ -1,40 +0,0 @@ -## vela route - -Attach route trait to an app - -### Synopsis - -Attach route trait to an app - -``` -vela route [args] -``` - -### Examples - -``` -vela route frontend -``` - -### Options - -``` - --detach detach trait from service - --domain string Domain name - -h, --help help for route - --issuer string - -s, --staging only save changes locally without real update application - --svc string specify one service belonging to the application -``` - -### Options inherited from parent commands - -``` - -e, --env string specify environment name for application -``` - -### SEE ALSO - -* [vela](vela.md) - - -###### Auto generated by spf13/cobra on 9-Dec-2020 diff --git a/docs/en/cli/vela_scaler.md b/docs/en/cli/vela_scaler.md deleted file mode 100644 index 27f95b736..000000000 --- a/docs/en/cli/vela_scaler.md +++ /dev/null @@ -1,39 +0,0 @@ -## vela scaler - -Attach scaler trait to an app - -### Synopsis - -Attach scaler trait to an app - -``` -vela scaler [args] -``` - -### Examples - -``` -vela scaler frontend -``` - -### Options - -``` - --detach detach trait from service - -h, --help help for scaler - -r, --replicas int Replicas of the workload (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 - -``` - -e, --env string specify environment name for application -``` - -### SEE ALSO - -* [vela](vela.md) - - -###### Auto generated by spf13/cobra on 9-Dec-2020 diff --git a/docs/en/cli/vela_show.md b/docs/en/cli/vela_show.md index e8547dfcb..736933c31 100644 --- a/docs/en/cli/vela_show.md +++ b/docs/en/cli/vela_show.md @@ -1,26 +1,26 @@ ## vela show -Show details of an application +Show the reference doc for a workload type or trait ### Synopsis -Show details of an application +Show the reference doc for a workload type or trait ``` -vela show APP_NAME [flags] +vela show [flags] ``` ### Examples ``` -vela show APP_NAME +show webservice ``` ### Options ``` - -h, --help help for show - -s, --svc string service name + -h, --help help for show + --web start web doc site ``` ### Options inherited from parent commands @@ -33,4 +33,4 @@ vela show APP_NAME * [vela](vela.md) - -###### Auto generated by spf13/cobra on 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_status.md b/docs/en/cli/vela_status.md index 027ad2f6d..e03423b77 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_svc.md b/docs/en/cli/vela_svc.md deleted file mode 100644 index 4cae72a31..000000000 --- a/docs/en/cli/vela_svc.md +++ /dev/null @@ -1,27 +0,0 @@ -## vela svc - -Manage services - -### Synopsis - -Manage services - -### Options - -``` - -a, --app string specify the name of application containing the services - -h, --help help for svc -``` - -### Options inherited from parent commands - -``` - -e, --env string specify environment name for application -``` - -### SEE ALSO - -* [vela](vela.md) - -* [vela svc deploy](vela_svc_deploy.md) - Initialize and run a service - -###### Auto generated by spf13/cobra on 9-Dec-2020 diff --git a/docs/en/cli/vela_svc_deploy.md b/docs/en/cli/vela_svc_deploy.md deleted file mode 100644 index 4a815a892..000000000 --- a/docs/en/cli/vela_svc_deploy.md +++ /dev/null @@ -1,38 +0,0 @@ -## vela svc deploy - -Initialize and run a service - -### Synopsis - -Initialize and run a service. The app name would be the same as service name, if it's not specified. - -``` -vela svc deploy [args] -``` - -### Examples - -``` -vela svc deploy -t -``` - -### Options - -``` - -h, --help help for deploy - -s, --staging only save changes locally without real update application - -t, --type string specify workload type of the service -``` - -### Options inherited from parent commands - -``` - -a, --app string specify the name of application containing the services - -e, --env string specify environment name for application -``` - -### SEE ALSO - -* [vela svc](vela_svc.md) - Manage services - -###### Auto generated by spf13/cobra on 9-Dec-2020 diff --git a/docs/en/cli/vela_system.md b/docs/en/cli/vela_system.md index e80b4eba3..6cbd94abe 100644 --- a/docs/en/cli/vela_system.md +++ b/docs/en/cli/vela_system.md @@ -21,6 +21,7 @@ System management utilities ### SEE ALSO * [vela](vela.md) - +* [vela system dry-run](vela_system_dry-run.md) - Dry Run an application, and output the conversion result to stdout * [vela system info](vela_system_info.md) - Show vela client and cluster chartPath -###### Auto generated by spf13/cobra on 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_system_dry-run.md b/docs/en/cli/vela_system_dry-run.md new file mode 100644 index 000000000..e86f57f4b --- /dev/null +++ b/docs/en/cli/vela_system_dry-run.md @@ -0,0 +1,36 @@ +## vela system dry-run + +Dry Run an application, and output the conversion result to stdout + +### Synopsis + +Dry Run an application, and output the conversion result to stdout + +``` +vela system dry-run +``` + +### Examples + +``` +vela dry-run +``` + +### Options + +``` + -f, --file string application file name (default "./app.yaml") + -h, --help help for dry-run +``` + +### Options inherited from parent commands + +``` + -e, --env string specify environment name for application +``` + +### SEE ALSO + +* [vela system](vela_system.md) - System management utilities + +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_system_info.md b/docs/en/cli/vela_system_info.md index 81404bb8c..f4972e31e 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_template.md b/docs/en/cli/vela_template.md index ef69efad6..524e66c55 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_template_context.md b/docs/en/cli/vela_template_context.md index 98f4c0d55..9d3fe2f21 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_traits.md b/docs/en/cli/vela_traits.md index a1ba66fc7..074cddb33 100644 --- a/docs/en/cli/vela_traits.md +++ b/docs/en/cli/vela_traits.md @@ -19,6 +19,7 @@ vela traits ### Options ``` + -r, -- Enforce refresh from cluster even if cache is not expired --apply-to string Workload name -h, --help help for traits -s, --sync Synchronize capabilities from cluster into local (default true) @@ -34,4 +35,4 @@ vela traits * [vela](vela.md) - -###### Auto generated by spf13/cobra on 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_up.md b/docs/en/cli/vela_up.md index a27031f4f..849ccaace 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_version.md b/docs/en/cli/vela_version.md index 9d5cbe0d2..4275e6ad4 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 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/docs/en/cli/vela_workloads.md b/docs/en/cli/vela_workloads.md index 6ecd86a08..4ed9d52c1 100644 --- a/docs/en/cli/vela_workloads.md +++ b/docs/en/cli/vela_workloads.md @@ -19,6 +19,7 @@ vela workloads ### Options ``` + -r, -- Enforce refresh from cluster even if cache is not expired -h, --help help for workloads -s, --sync Synchronize capabilities from cluster into local (default true) ``` @@ -33,4 +34,4 @@ vela workloads * [vela](vela.md) - -###### Auto generated by spf13/cobra on 9-Dec-2020 +###### Auto generated by spf13/cobra on 28-Jan-2021 diff --git a/e2e/commonContext.go b/e2e/commonContext.go index f05748add..35a74ae36 100644 --- a/e2e/commonContext.go +++ b/e2e/commonContext.go @@ -6,7 +6,6 @@ import ( "io/ioutil" "net/http" "strings" - "time" "github.com/onsi/ginkgo" "github.com/onsi/gomega" @@ -16,19 +15,6 @@ import ( ) var ( - // SystemInitContext used for test install - SystemInitContext = func(context string) bool { - return ginkgo.Context(context, func() { - ginkgo.It("Install OAM runtime and vela builtin capabilities.", func() { - output, err := LongTimeExec("vela install --wait", 180*time.Second) - gomega.Expect(err).NotTo(gomega.HaveOccurred()) - gomega.Expect(output).To(gomega.ContainSubstring("- Installing OAM Kubernetes Runtime")) - gomega.Expect(output).To(gomega.ContainSubstring("- Installing builtin capabilities")) - gomega.Expect(output).To(gomega.ContainSubstring("Successful applied")) - gomega.Expect(output).To(gomega.ContainSubstring("Waiting KubeVela runtime ready to serve")) - }) - }) - } // EnvInitContext used for test Env EnvInitContext = func(context string, envName string) bool { @@ -113,17 +99,6 @@ var ( }) } - //WorkloadRunContext used for test vela svc deploy - WorkloadRunContext = func(context string, cli string) bool { - return ginkgo.Context(context, func() { - ginkgo.It("should print successful creation information", func() { - output, err := Exec(cli) - gomega.Expect(err).NotTo(gomega.HaveOccurred()) - gomega.Expect(output).To(gomega.ContainSubstring("deployed")) - }) - }) - } - WorkloadDeleteContext = func(context string, applicationName string) bool { return ginkgo.Context(context, func() { ginkgo.It("should print successful deletion information", func() { @@ -154,18 +129,6 @@ var ( }) }) } - // TraitManualScalerAttachContext used for test trait attach success - TraitManualScalerAttachContext = func(context string, traitAlias string, applicationName string) bool { - return ginkgo.Context(context, func() { - ginkgo.It("should print successful attached information", func() { - cli := fmt.Sprintf("vela %s %s", traitAlias, applicationName) - output, err := LongTimeExec(cli, 180*time.Second) - gomega.Expect(err).NotTo(gomega.HaveOccurred()) - gomega.Expect(output).To(gomega.ContainSubstring("Adding " + traitAlias + " for app")) - gomega.Expect(output).To(gomega.ContainSubstring("Checking Status")) - }) - }) - } // ComponentListContext used for test vela svc ls ComponentListContext = func(context string, applicationName string, workloadType string, traitAlias string) bool { diff --git a/e2e/system/system_suite_test.go b/e2e/system/system_suite_test.go deleted file mode 100644 index 687903033..000000000 --- a/e2e/system/system_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package e2e - -import ( - "testing" - - "github.com/onsi/ginkgo" - "github.com/onsi/gomega" -) - -func TestApplication(t *testing.T) { - gomega.RegisterFailHandler(ginkgo.Fail) - ginkgo.RunSpecs(t, "System Suite") -} diff --git a/e2e/system/system_test.go b/e2e/system/system_test.go deleted file mode 100644 index 64949a46b..000000000 --- a/e2e/system/system_test.go +++ /dev/null @@ -1,10 +0,0 @@ -package e2e - -import ( - "github.com/onsi/ginkgo" -) - -var _ = ginkgo.Describe("Application", func() { - // TODO(zzxwill) Need to find out why it failed in Github workflow. - //e2e.SystemInitContext("install") -}) diff --git a/e2e/trait/trait_test.go b/e2e/trait/trait_test.go index 023f1f824..e38dc670a 100644 --- a/e2e/trait/trait_test.go +++ b/e2e/trait/trait_test.go @@ -1,48 +1,11 @@ package e2e import ( - "fmt" - "github.com/onsi/ginkgo" - "github.com/onsi/gomega" "github.com/oam-dev/kubevela/e2e" ) -var ( - envName = "env-trait" - applicationName = "app-trait-basic" - applicationNotExistedName = "app-trait-basic-NOT-EXISTED" - traitAlias = "scaler" - serviceNameNotExisting = "svc-not-existing" -) - var _ = ginkgo.Describe("Trait", func() { e2e.TraitCapabilityListContext() - e2e.EnvInitContext("env init", envName) - e2e.EnvSetContext("env set", envName) - e2e.WorkloadRunContext("deploy", fmt.Sprintf("vela svc deploy -t webservice %s -p 80 --image nginx:1.9.4", applicationName)) - - e2e.TraitManualScalerAttachContext("vela attach trait", traitAlias, applicationName) - - // Trait - ginkgo.Context("vela attach trait to a not existing app", func() { - ginkgo.It("should alert app not exist", func() { - cli := fmt.Sprintf("vela %s %s", traitAlias, applicationNotExistedName) - output, err := e2e.Exec(cli) - gomega.Expect(err).NotTo(gomega.HaveOccurred()) - gomega.Expect(output).To(gomega.ContainSubstring("the application " + applicationNotExistedName + " doesn't exist in current env " + envName)) - }) - }) - - ginkgo.Context("vela attach trait to a not existing service", func() { - ginkgo.It("should alert service not exist", func() { - cli := fmt.Sprintf("vela %s %s --svc %s", traitAlias, applicationName, serviceNameNotExisting) - output, err := e2e.Exec(cli) - gomega.Expect(err).NotTo(gomega.HaveOccurred()) - gomega.Expect(output).To(gomega.ContainSubstring("the service " + serviceNameNotExisting + " doesn't exist in the application " + applicationName)) - }) - }) - - e2e.WorkloadDeleteContext("delete", applicationName) }) diff --git a/e2e/workload/workload_test.go b/e2e/workload/workload_test.go index de5b51cfb..ce331a991 100644 --- a/e2e/workload/workload_test.go +++ b/e2e/workload/workload_test.go @@ -1,34 +1,11 @@ package e2e import ( - "fmt" - "github.com/onsi/ginkgo" - "github.com/onsi/gomega" "github.com/oam-dev/kubevela/e2e" ) -var ( - envName = "env-workload" - applicationName = "app-workload-basic" - notEnoughFlagsApplicationName = "app-workload-basic" -) - var _ = ginkgo.Describe("Workload", func() { e2e.WorkloadCapabilityListContext() - e2e.EnvInitContext("env init", envName) - e2e.EnvSetContext("env set", envName) - e2e.WorkloadRunContext("deploy", fmt.Sprintf("vela svc deploy -t webservice %s -p 80 --image nginx:1.9.4", applicationName)) - - ginkgo.Context("run without enough flags", func() { - ginkgo.It("should throw error message: some flags are NOT set", func() { - cli := fmt.Sprintf("vela svc deploy -t webservice %s -p 80", notEnoughFlagsApplicationName) - output, err := e2e.Exec(cli) - gomega.Expect(err).NotTo(gomega.HaveOccurred()) - gomega.Expect(output).To(gomega.ContainSubstring("required flag(s) \"image\" not set")) - }) - }) - - e2e.WorkloadDeleteContext("delete", applicationName) }) diff --git a/pkg/commands/cli.go b/pkg/commands/cli.go index eebbd1bbf..657ddde2c 100644 --- a/pkg/commands/cli.go +++ b/pkg/commands/cli.go @@ -81,16 +81,8 @@ func NewCommand() *cobra.Command { NewDashboardCommand(commandArgs, ioStream, fake.FrontendSource), NewCompletionCommand(), NewVersionCommand(), - - AddCompCommands(commandArgs, ioStream), ) - // Traits - if err := AddTraitCommands(cmds, commandArgs, ioStream); err != nil { - fmt.Println("Add trait commands from traitDefinition err", err) - os.Exit(1) - } - // this is for mute klog fset := flag.NewFlagSet("logs", flag.ContinueOnError) klog.InitFlags(fset) diff --git a/pkg/commands/common.go b/pkg/commands/common.go new file mode 100644 index 000000000..b360f5f19 --- /dev/null +++ b/pkg/commands/common.go @@ -0,0 +1,23 @@ +/* +Copyright 2020 The KubeVela Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package commands + +// constants used in `svc` command +const ( + App = "app" + Service = "svc" +) diff --git a/pkg/commands/comp.go b/pkg/commands/comp.go deleted file mode 100644 index 8ad7707a6..000000000 --- a/pkg/commands/comp.go +++ /dev/null @@ -1,183 +0,0 @@ -// nolint:golint -// We will soon deprecate this command, we should use 'vela up' as the only deploy command. -package commands - -import ( - "errors" - "fmt" - - "github.com/spf13/cobra" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/oam-dev/kubevela/apis/types" - "github.com/oam-dev/kubevela/pkg/commands/util" - cmdutil "github.com/oam-dev/kubevela/pkg/commands/util" - "github.com/oam-dev/kubevela/pkg/plugins" - "github.com/oam-dev/kubevela/pkg/serverlib" -) - -// constants used in `svc` command -const ( - Staging = "staging" - App = "app" - WorkloadType = "type" - TraitDetach = "detach" - Service = "svc" -) - -type runOptions serverlib.RunOptions - -func newRunOptions(ioStreams util.IOStreams) *runOptions { - return &runOptions{IOStreams: ioStreams} -} - -// AddCompCommands creates `svc` command and its nested children command -func AddCompCommands(c types.Args, ioStreams util.IOStreams) *cobra.Command { - compCommands := &cobra.Command{ - Use: "svc", - DisableFlagsInUseLine: true, - Short: "Manage services", - Long: "Manage services", - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - return c.SetConfig() - }, - } - compCommands.PersistentFlags().StringP(App, "a", "", "specify the name of application containing the services") - - compCommands.AddCommand( - NewCompDeployCommands(c, ioStreams), - ) - return compCommands -} - -// NewCompDeployCommands creates `deploy` command -func NewCompDeployCommands(c types.Args, ioStreams util.IOStreams) *cobra.Command { - runCmd := &cobra.Command{ - Use: "deploy [args]", - DisableFlagsInUseLine: true, - // Dynamic flag parse in compeletion - DisableFlagParsing: true, - Short: "Initialize and run a service", - Long: "Initialize and run a service. The app name would be the same as service name, if it's not specified.", - Example: "vela svc deploy -t ", - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - return c.SetConfig() - }, - RunE: func(cmd *cobra.Command, args []string) error { - if len(args) == 0 || args[0] == "-h" { - err := cmd.Help() - if err != nil { - return err - } - return nil - } - o := newRunOptions(ioStreams) - newClient, err := client.New(c.Config, client.Options{Scheme: c.Schema}) - if err != nil { - return err - } - o.KubeClient = newClient - o.Env, err = GetEnv(cmd) - if err != nil { - return err - } - if err := o.Complete(cmd, args); err != nil { - return err - } - return o.Run(cmd, ioStreams) - }, - Annotations: map[string]string{ - types.TagCommandType: types.TypeApp, - }, - } - runCmd.SetOut(ioStreams.Out) - - runCmd.Flags().BoolP(Staging, "s", false, "only save changes locally without real update application") - runCmd.Flags().StringP(WorkloadType, "t", "", "specify workload type of the service") - - return runCmd -} - -// GetWorkloadNameFromArgs gets workload from the args -func GetWorkloadNameFromArgs(args []string) (string, error) { - argsLength := len(args) - if argsLength < 1 { - return "", errors.New("must specify the name of service") - } - return args[0], nil - -} - -func (o *runOptions) Complete(cmd *cobra.Command, args []string) error { - flags := cmd.Flags() - flags.AddFlagSet(cmd.PersistentFlags()) - flags.ParseErrorsWhitelist.UnknownFlags = true - - // First parse, figure out which workloadType it is. - if err := flags.Parse(args); err != nil { - return err - } - - workloadName, err := GetWorkloadNameFromArgs(flags.Args()) - if err != nil { - return err - } - - appName, err := flags.GetString(App) - if err != nil { - return err - } - workloadType, err := flags.GetString(WorkloadType) - if err != nil { - return err - } - if workloadType == "" { - workloads, err := plugins.LoadInstalledCapabilityWithType(types.TypeWorkload) - if err != nil { - return err - } - var workloadList []string - for _, w := range workloads { - workloadList = append(workloadList, w.Name) - } - errMsg := "can not find workload, check workloads by `vela workloads` and choose a suitable one." - if workloadList != nil { - errMsg = fmt.Sprintf("must specify the workload type of service, please use `-t` and choose from %v.", workloadList) - } - return errors.New(errMsg) - } - envName := o.Env.Name - - // Dynamic load flags - template, err := plugins.LoadCapabilityByName(workloadType) - if err != nil { - return err - } - for _, v := range template.Parameters { - types.SetFlagBy(flags, v) - } - // Second parse, parse parameters of this workload. - if err = flags.Parse(args); err != nil { - return err - } - app, err := serverlib.BaseComplete(envName, workloadName, appName, flags, workloadType) - if err != nil { - return err - } - - o.App = app - return err -} - -func (o *runOptions) Run(cmd *cobra.Command, io cmdutil.IOStreams) error { - staging, err := cmd.Flags().GetBool(Staging) - if err != nil { - return err - } - msg, err := serverlib.BaseRun(staging, o.App, o.KubeClient, o.Env, io) - if err != nil { - return err - } - o.Info(msg) - return nil -} diff --git a/pkg/commands/trait.go b/pkg/commands/trait.go deleted file mode 100644 index c7b298671..000000000 --- a/pkg/commands/trait.go +++ /dev/null @@ -1,180 +0,0 @@ -package commands - -import ( - "context" - "errors" - "fmt" - - "github.com/spf13/cobra" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/oam-dev/kubevela/apis/types" - "github.com/oam-dev/kubevela/pkg/appfile" - "github.com/oam-dev/kubevela/pkg/appfile/api" - "github.com/oam-dev/kubevela/pkg/commands/util" - cmdutil "github.com/oam-dev/kubevela/pkg/commands/util" - "github.com/oam-dev/kubevela/pkg/plugins" - "github.com/oam-dev/kubevela/pkg/serverlib" -) - -type commandOptions struct { - Template types.Capability - Client client.Client - Detach bool - Env *types.EnvMeta - - workloadName string - appName string - app *api.Application - traitType string - cmdutil.IOStreams -} - -// AddTraitCommands loads Trait command from installed capabilities -func AddTraitCommands(parentCmd *cobra.Command, c types.Args, ioStreams cmdutil.IOStreams) error { - templates, err := plugins.LoadInstalledCapabilityWithType(types.TypeTrait) - if err != nil { - return err - } - ctx := context.Background() - for _, tmp := range templates { - tmp := tmp - - var name = tmp.Name - pluginCmd := &cobra.Command{ - // 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", - Long: "Attach " + name + " trait to an app", - Example: "vela " + name + " frontend", - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - return c.SetConfig() - }, - RunE: func(cmd *cobra.Command, args []string) error { - o := &commandOptions{IOStreams: ioStreams, traitType: name} - o.Template = tmp - newClient, err := client.New(c.Config, client.Options{Scheme: c.Schema}) - if err != nil { - return err - } - o.Client = newClient - o.Env, err = GetEnv(cmd) - if err != nil { - return err - } - detach, _ := cmd.Flags().GetBool(TraitDetach) - if detach { - if err := o.DetachTrait(cmd, args); err != nil { - return err - } - o.Detach = true - } else if err := o.AddOrUpdateTrait(cmd, args); err != nil { - return err - } - return o.Run(ctx, cmd, ioStreams) - }, - } - pluginCmd.SetOut(ioStreams.Out) - for _, v := range tmp.Parameters { - types.SetFlagBy(pluginCmd.Flags(), v) - } - pluginCmd.Flags().StringP(Service, "", "", "specify one service belonging to the application") - pluginCmd.Flags().BoolP(Staging, "s", false, "only save changes locally without real update application") - pluginCmd.Flags().BoolP(TraitDetach, "", false, "detach trait from service") - - parentCmd.AddCommand(pluginCmd) - } - return nil -} - -// Prepare prepares data for constructing OAM entities -func (o *commandOptions) Prepare(cmd *cobra.Command, args []string) error { - if len(args) < 1 { - return errors.New("please specify the name of the app") - } - o.appName = args[0] - // get application - app, err := appfile.LoadApplication(o.Env.Name, o.appName) - if err != nil { - if appfile.IsNotFound(o.appName, err) { - return fmt.Errorf("the application %s doesn't exist in current env %s", o.appName, o.Env.Name) - } - return err - } - - // get service name - serviceNames := appfile.GetComponents(app) - if svcName := cmd.Flag(Service).Value.String(); svcName != "" { - for _, v := range serviceNames { - if v == svcName { - o.workloadName = svcName - return nil - } - } - return fmt.Errorf("the service %s doesn't exist in the application %s", svcName, o.appName) - } - svcName, err := util.AskToChooseOneService(serviceNames) - if err != nil { - return err - } - o.workloadName = svcName - return nil -} - -// AddOrUpdateTrait adds or updates trait -func (o *commandOptions) AddOrUpdateTrait(cmd *cobra.Command, args []string) error { - var err error - if err = o.Prepare(cmd, args); err != nil { - return err - } - flags := cmd.Flags() - - if o.app, err = serverlib.AddOrUpdateTrait(o.Env, o.appName, o.workloadName, flags, o.Template); err != nil { - return err - } - return nil -} - -// DetachTrait removes a trait already attached to a service -func (o *commandOptions) DetachTrait(cmd *cobra.Command, args []string) error { - var err error - if err = o.Prepare(cmd, args); err != nil { - return err - } - if o.app, err = serverlib.PrepareDetachTrait(o.Env.Name, o.traitType, o.workloadName, o.appName); err != nil { - return err - } - var traitType = o.Template.Name - if err = appfile.RemoveTrait(o.app, o.workloadName, traitType); err != nil { - return err - } - return appfile.Save(o.app, o.Env.Name) -} - -// Run executes create/update/detach trait -func (o *commandOptions) Run(ctx context.Context, cmd *cobra.Command, io cmdutil.IOStreams) error { - if o.Detach { - o.Infof("Detaching %s from app %s\n", o.traitType, o.workloadName) - } else { - o.Infof("Adding %s for app %s \n", o.Template.Name, o.workloadName) - } - staging, err := cmd.Flags().GetBool(Staging) - if err != nil { - return err - } - _, err = serverlib.TraitOperationRun(ctx, o.Client, o.Env, o.app, staging, io) - if err != nil { - return err - } - deployStatus, err := printTrackingDeployStatus(ctx, o.Client, o.IOStreams, o.workloadName, o.appName, o.Env) - if err != nil { - return err - } - if deployStatus != compStatusDeployed { - return nil - } - - return printComponentStatus(context.Background(), o.Client, o.IOStreams, o.workloadName, o.appName, o.Env) -}