diff --git a/docs/Developer-Guide.md b/docs/Developer-Guide.md index 32dd3260db..cad683313f 100644 --- a/docs/Developer-Guide.md +++ b/docs/Developer-Guide.md @@ -104,7 +104,7 @@ The build will create the following: You can check if your system is capable of creating a Kata Container by running the following: ``` -$ sudo kata-runtime kata-check +$ sudo kata-runtime check ``` If your system is *not* able to run Kata Containers, the previous command will error out and explain why. diff --git a/docs/Documentation-Requirements.md b/docs/Documentation-Requirements.md index c1cea47a40..bd276d03f1 100644 --- a/docs/Documentation-Requirements.md +++ b/docs/Documentation-Requirements.md @@ -25,7 +25,7 @@ All documents must: - Have a `.md` file extension. - Include a TOC (table of contents) at the top of the document with links to all heading sections. We recommend using the - [`kata-check-markdown`](https://github.com/kata-containers/tests/tree/master/cmd/check-markdown) + [`check-markdown`](https://github.com/kata-containers/tests/tree/master/cmd/check-markdown) tool to generate the TOC. - Be linked to from another document in the same repository. diff --git a/docs/Upgrading.md b/docs/Upgrading.md index 3d8a554927..062c85ebd6 100644 --- a/docs/Upgrading.md +++ b/docs/Upgrading.md @@ -48,10 +48,10 @@ Alternatively, if you are using Kata Containers version 1.12.0 or newer, you can check for newer releases using the command line: ```bash -$ kata-runtime kata-check --check-version-only +$ kata-runtime check --check-version-only ``` -There are various other related options. Run `kata-runtime kata-check --help` +There are various other related options. Run `kata-runtime check --help` for further details. # Configuration changes diff --git a/docs/install/container-manager/containerd/containerd-install.md b/docs/install/container-manager/containerd/containerd-install.md index c9da0120f7..cc826bf776 100644 --- a/docs/install/container-manager/containerd/containerd-install.md +++ b/docs/install/container-manager/containerd/containerd-install.md @@ -18,7 +18,7 @@ > > - If you decide to proceed and install a Kata Containers release, you can > still check for the latest version of Kata Containers by running -> `kata-runtime kata-check --only-list-releases`. +> `kata-runtime check --only-list-releases`. > > - These instructions will not work for Fedora 31 and higher since those > distribution versions only support cgroups version 2 by default. However, diff --git a/docs/install/gce-installation-guide.md b/docs/install/gce-installation-guide.md index 389bec160f..b53cef40c5 100644 --- a/docs/install/gce-installation-guide.md +++ b/docs/install/gce-installation-guide.md @@ -6,7 +6,7 @@ * [Install Kata](#install-kata) * [Create a Kata-enabled Image](#create-a-kata-enabled-image) -Kata Containers on Google Compute Engine (GCE) makes use of [nested virtualization](https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances). Most of the installation procedure is identical to that for Kata on your preferred distribution, but enabling nested virtualization currently requires extra steps on GCE. This guide walks you through creating an image and instance with nested virtualization enabled. Note that `kata-runtime kata-check` checks for nested virtualization, but does not fail if support is not found. +Kata Containers on Google Compute Engine (GCE) makes use of [nested virtualization](https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances). Most of the installation procedure is identical to that for Kata on your preferred distribution, but enabling nested virtualization currently requires extra steps on GCE. This guide walks you through creating an image and instance with nested virtualization enabled. Note that `kata-runtime check` checks for nested virtualization, but does not fail if support is not found. As a pre-requisite this guide assumes an installed and configured instance of the [Google Cloud SDK](https://cloud.google.com/sdk/downloads). For a zero-configuration option, all of the commands below were been tested under [Google Cloud Shell](https://cloud.google.com/shell/) (as of Jun 2018). Verify your `gcloud` installation and configuration: diff --git a/docs/install/minikube-installation-guide.md b/docs/install/minikube-installation-guide.md index fe75fa08c0..4c27fc695a 100644 --- a/docs/install/minikube-installation-guide.md +++ b/docs/install/minikube-installation-guide.md @@ -54,7 +54,7 @@ to enable nested virtualization can be found on the [KVM Nested Guests page](https://www.linux-kvm.org/page/Nested_Guests) Alternatively, and for other architectures, the Kata Containers built in -[`kata-check`](../../src/runtime/README.md#hardware-requirements) +[`check`](../../src/runtime/README.md#hardware-requirements) command can be used *inside Minikube* once Kata has been installed, to check for compatibility. ## Setting up Minikube diff --git a/src/runtime/README.md b/src/runtime/README.md index beaa6c34fd..b5ee5dc3ad 100644 --- a/src/runtime/README.md +++ b/src/runtime/README.md @@ -65,7 +65,7 @@ The runtime has a built-in command to determine if your host system is capable of running and creating a Kata Container: ```bash -$ kata-runtime kata-check +$ kata-runtime check ``` > **Note:** @@ -135,7 +135,7 @@ To see details of your systems runtime environment (including the location of the configuration file being used), run: ```bash -$ kata-runtime kata-env +$ kata-runtime env ``` ## Logging diff --git a/src/runtime/cli/config-generated.go.in b/src/runtime/cli/config-generated.go.in index 41ce38ac3b..3e0589f498 100644 --- a/src/runtime/cli/config-generated.go.in +++ b/src/runtime/cli/config-generated.go.in @@ -36,10 +36,6 @@ var commit = "@COMMIT@" // version is the runtime version. var version = "@VERSION@" -// project-specific command names -var envCmd = fmt.Sprintf("%s-env", projectPrefix) -var checkCmd = fmt.Sprintf("%s-check", projectPrefix) - // project-specific option names var configFilePathOption = fmt.Sprintf("%s-config", projectPrefix) var showConfigPathsOption = fmt.Sprintf("%s-show-default-config-paths", projectPrefix) diff --git a/src/runtime/cli/kata-check.go b/src/runtime/cli/kata-check.go index 6755f52cfd..6b50e46fb8 100644 --- a/src/runtime/cli/kata-check.go +++ b/src/runtime/cli/kata-check.go @@ -306,8 +306,9 @@ func genericHostIsVMContainerCapable(details vmContainerCapableDetails) error { } var kataCheckCLICommand = cli.Command{ - Name: checkCmd, - Usage: "tests if system can run " + project, + Name: "check", + Aliases: []string{"kata-check"}, + Usage: "tests if system can run " + project, Flags: []cli.Flag{ cli.BoolFlag{ Name: "check-version-only", @@ -344,36 +345,36 @@ EXAMPLES: - Perform basic checks: - $ %s %s + $ %s check - Local basic checks only: - $ %s %s --no-network-checks + $ %s check --no-network-checks - Perform further checks: - $ sudo %s %s + $ sudo %s check - Just check if a newer version is available: - $ %s %s --check-version-only + $ %s check --check-version-only - List available releases (shows output in format "version;release-date;url"): - $ %s %s --only-list-releases + $ %s check --only-list-releases - List all available releases (includes pre-release versions): - $ %s %s --only-list-releases --include-all-releases + $ %s check --only-list-releases --include-all-releases `, project, noNetworkEnvVar, - name, checkCmd, - name, checkCmd, - name, checkCmd, - name, checkCmd, - name, checkCmd, - name, checkCmd, + name, + name, + name, + name, + name, + name, ), Action: func(context *cli.Context) error { @@ -386,7 +387,7 @@ EXAMPLES: return err } - span, _ := katautils.Trace(ctx, "kata-check") + span, _ := katautils.Trace(ctx, "check") defer span.Finish() if context.Bool("no-network-checks") == false && os.Getenv(noNetworkEnvVar) == "" { @@ -413,7 +414,7 @@ EXAMPLES: runtimeConfig, ok := context.App.Metadata["runtimeConfig"].(oci.RuntimeConfig) if !ok { - return errors.New("kata-check: cannot determine runtime config") + return errors.New("check: cannot determine runtime config") } err = setCPUtype(runtimeConfig.HypervisorType) diff --git a/src/runtime/cli/kata-env.go b/src/runtime/cli/kata-env.go index 0c555ed311..01286b3b90 100644 --- a/src/runtime/cli/kata-env.go +++ b/src/runtime/cli/kata-env.go @@ -437,8 +437,9 @@ func writeJSONSettings(env EnvInfo, file *os.File) error { } var kataEnvCLICommand = cli.Command{ - Name: envCmd, - Usage: "display settings. Default to TOML", + Name: "env", + Aliases: []string{"kata-env"}, + Usage: "display settings. Default to TOML", Flags: []cli.Flag{ cli.BoolFlag{ Name: "json", diff --git a/src/runtime/cli/main.go b/src/runtime/cli/main.go index 2b721eaa21..28ff5de369 100644 --- a/src/runtime/cli/main.go +++ b/src/runtime/cli/main.go @@ -272,7 +272,7 @@ func beforeSubcommands(c *cli.Context) error { ignoreConfigLogs := false var traceRootSpan string - subCmdIsCheckCmd := (c.NArg() >= 1 && (c.Args()[0] == checkCmd)) + subCmdIsCheckCmd := (c.NArg() >= 1 && ((c.Args()[0] == "kata-check") || (c.Args()[0] == "check"))) if subCmdIsCheckCmd { // checkCmd will use the default logrus logger to stderr // raise the logger default level to warn @@ -313,7 +313,7 @@ func beforeSubcommands(c *cli.Context) error { // (meaning any spans created at this point will be silently ignored). setExternalLoggers(context.Background(), kataLog) - if c.NArg() == 1 && c.Args()[0] == envCmd { + if c.NArg() == 1 && (c.Args()[0] == "kata-env" || c.Args()[0] == "env") { // simply report the logging setup ignoreConfigLogs = true } diff --git a/src/runtime/data/completions/bash/kata-runtime b/src/runtime/data/completions/bash/kata-runtime index c293483d60..0b42c7997e 100644 --- a/src/runtime/data/completions/bash/kata-runtime +++ b/src/runtime/data/completions/bash/kata-runtime @@ -63,6 +63,8 @@ _kata_subcmd_needs_existing_container() for cmd in \ 'kata-check' \ 'kata-env' \ + 'check' \ + 'env' \ 'create' \ 'help' \ 'list' \ diff --git a/utils/kata-manager.sh b/utils/kata-manager.sh index 1538eb8a60..1a8b7d1f97 100755 --- a/utils/kata-manager.sh +++ b/utils/kata-manager.sh @@ -210,7 +210,7 @@ Advice: - You can check the latest version of Kata Containers by running: - $ kata-runtime kata-check --only-list-releases + $ kata-runtime check --only-list-releases EOT }