diff --git a/cmd/ignite-spawn/ignite-spawn.go b/cmd/ignite-spawn/ignite-spawn.go index 14f4df605..d150fa6db 100644 --- a/cmd/ignite-spawn/ignite-spawn.go +++ b/cmd/ignite-spawn/ignite-spawn.go @@ -93,6 +93,6 @@ func patchStopped(vm *api.VM) error { vm.status.startTime = nil */ - patch := []byte(`{"status":{"running":false,"ipAddresses":null,"runtime":null,"startTime":null}}`) + patch := []byte(`{"status":{"running":false,"network":null,"runtime":null,"startTime":null}}`) return patchutil.NewPatcher(scheme.Serializer).ApplyOnFile(constants.IGNITE_SPAWN_VM_FILE_PATH, patch, vm.GroupVersionKind()) } diff --git a/cmd/ignite/cmd/imgcmd/import.go b/cmd/ignite/cmd/imgcmd/import.go index eb98e1b8b..66edbcf42 100644 --- a/cmd/ignite/cmd/imgcmd/import.go +++ b/cmd/ignite/cmd/imgcmd/import.go @@ -5,8 +5,12 @@ import ( "github.com/lithammer/dedent" "github.com/spf13/cobra" + "github.com/spf13/pflag" + "github.com/weaveworks/ignite/cmd/ignite/cmd/cmdutil" "github.com/weaveworks/ignite/cmd/ignite/run" + "github.com/weaveworks/ignite/pkg/providers" + runtimeflag "github.com/weaveworks/ignite/pkg/runtime/flag" ) // NewCmdImport imports a new VM image @@ -27,5 +31,11 @@ func NewCmdImport(out io.Writer) *cobra.Command { }()) }, } + + addImportFlags(cmd.Flags()) return cmd } + +func addImportFlags(fs *pflag.FlagSet) { + runtimeflag.RuntimeVar(fs, &providers.RuntimeName) +} diff --git a/cmd/ignite/cmd/kerncmd/import.go b/cmd/ignite/cmd/kerncmd/import.go index 901703509..2ad3af111 100644 --- a/cmd/ignite/cmd/kerncmd/import.go +++ b/cmd/ignite/cmd/kerncmd/import.go @@ -5,8 +5,12 @@ import ( "github.com/lithammer/dedent" "github.com/spf13/cobra" + "github.com/spf13/pflag" + "github.com/weaveworks/ignite/cmd/ignite/cmd/cmdutil" "github.com/weaveworks/ignite/cmd/ignite/run" + "github.com/weaveworks/ignite/pkg/providers" + runtimeflag "github.com/weaveworks/ignite/pkg/runtime/flag" ) // NewCmdImport imports a new kernel image @@ -27,5 +31,11 @@ func NewCmdImport(out io.Writer) *cobra.Command { }()) }, } + + addImportFlags(cmd.Flags()) return cmd } + +func addImportFlags(fs *pflag.FlagSet) { + runtimeflag.RuntimeVar(fs, &providers.RuntimeName) +} diff --git a/cmd/ignite/cmd/root.go b/cmd/ignite/cmd/root.go index f8c276a5b..b169c88da 100644 --- a/cmd/ignite/cmd/root.go +++ b/cmd/ignite/cmd/root.go @@ -15,10 +15,8 @@ import ( "github.com/weaveworks/ignite/pkg/config" "github.com/weaveworks/ignite/pkg/logs" logflag "github.com/weaveworks/ignite/pkg/logs/flag" - networkflag "github.com/weaveworks/ignite/pkg/network/flag" "github.com/weaveworks/ignite/pkg/providers" "github.com/weaveworks/ignite/pkg/providers/ignite" - runtimeflag "github.com/weaveworks/ignite/pkg/runtime/flag" "github.com/weaveworks/ignite/pkg/util" versioncmd "github.com/weaveworks/ignite/pkg/version/cmd" ) @@ -133,8 +131,6 @@ func isNonRootCommand(cmd string, parentCmd string) bool { func addGlobalFlags(fs *pflag.FlagSet) { AddQuietFlag(fs) logflag.LogLevelFlagVar(fs, &logLevel) - runtimeflag.RuntimeVar(fs, &providers.RuntimeName) - networkflag.NetworkPluginVar(fs, &providers.NetworkPluginName) fs.StringVar(&configPath, "ignite-config", "", "Ignite configuration path; refer to the 'Ignite Configuration' docs for more details") } diff --git a/cmd/ignite/cmd/vmcmd/create.go b/cmd/ignite/cmd/vmcmd/create.go index d16adbc13..e58e1ea6c 100644 --- a/cmd/ignite/cmd/vmcmd/create.go +++ b/cmd/ignite/cmd/vmcmd/create.go @@ -7,8 +7,12 @@ import ( "github.com/lithammer/dedent" "github.com/spf13/cobra" "github.com/spf13/pflag" + "github.com/weaveworks/ignite/cmd/ignite/cmd/cmdutil" "github.com/weaveworks/ignite/cmd/ignite/run" + networkflag "github.com/weaveworks/ignite/pkg/network/flag" + "github.com/weaveworks/ignite/pkg/providers" + runtimeflag "github.com/weaveworks/ignite/pkg/runtime/flag" "github.com/weaveworks/ignite/pkg/version" ) @@ -80,4 +84,7 @@ func addCreateFlags(fs *pflag.FlagSet, cf *run.CreateFlags) { cmdutil.OCIImageRefVar(fs, &cf.VM.Spec.Sandbox.OCI, "sandbox-image", "Specify an OCI image for the VM sandbox") cmdutil.SSHVar(fs, &cf.SSH) cmdutil.VolumeVarP(fs, &cf.VM.Spec.Storage, "volumes", "v", "Expose block devices from the host inside the VM") + + runtimeflag.RuntimeVar(fs, &providers.RuntimeName) + networkflag.NetworkPluginVar(fs, &providers.NetworkPluginName) } diff --git a/cmd/ignite/cmd/vmcmd/start.go b/cmd/ignite/cmd/vmcmd/start.go index 66bb05a4d..a304b54fe 100644 --- a/cmd/ignite/cmd/vmcmd/start.go +++ b/cmd/ignite/cmd/vmcmd/start.go @@ -8,6 +8,9 @@ import ( "github.com/spf13/pflag" "github.com/weaveworks/ignite/cmd/ignite/cmd/cmdutil" "github.com/weaveworks/ignite/cmd/ignite/run" + networkflag "github.com/weaveworks/ignite/pkg/network/flag" + "github.com/weaveworks/ignite/pkg/providers" + runtimeflag "github.com/weaveworks/ignite/pkg/runtime/flag" ) // NewCmdStart starts a VM @@ -36,6 +39,13 @@ func NewCmdStart(out io.Writer) *cobra.Command { } addStartFlags(cmd.Flags(), sf) + + // NOTE: Since the run command combines the create and start command flags, + // to avoid redefining runtime and network flag in run command, they are + // defined separately here. + runtimeflag.RuntimeVar(cmd.Flags(), &providers.RuntimeName) + networkflag.NetworkPluginVar(cmd.Flags(), &providers.NetworkPluginName) + return cmd } diff --git a/cmd/ignite/run/attach.go b/cmd/ignite/run/attach.go index 5be8649b9..21ef6e02f 100644 --- a/cmd/ignite/run/attach.go +++ b/cmd/ignite/run/attach.go @@ -4,6 +4,7 @@ import ( "fmt" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/config" "github.com/weaveworks/ignite/pkg/providers" "github.com/weaveworks/ignite/pkg/util" ) @@ -27,6 +28,11 @@ func Attach(ao *AttachOptions) error { return fmt.Errorf("VM %q is not running", ao.vm.GetUID()) } + // Set the runtime and network-plugin providers from the VM status. + if err := config.SetAndPopulateProviders(ao.vm.Status.Runtime.Name, ao.vm.Status.Network.Plugin); err != nil { + return err + } + // Print the ID before attaching fmt.Println(ao.vm.GetUID()) diff --git a/cmd/ignite/run/create.go b/cmd/ignite/run/create.go index 5e6bfe257..6cadd1545 100644 --- a/cmd/ignite/run/create.go +++ b/cmd/ignite/run/create.go @@ -10,6 +10,7 @@ import ( "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" "github.com/weaveworks/ignite/pkg/apis/ignite/validation" meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" + "github.com/weaveworks/ignite/pkg/config" "github.com/weaveworks/ignite/pkg/dmlegacy" "github.com/weaveworks/ignite/pkg/metadata" "github.com/weaveworks/ignite/pkg/operations" @@ -57,6 +58,15 @@ func (cf *CreateFlags) NewCreateOptions(args []string, fs *flag.FlagSet) (*Creat baseVM.Spec = providers.ComponentConfig.Spec.VMDefaults } + // Set the runtime and network-plugin on the VM. This overrides the global + // config. + baseVM.Status.Runtime.Name = providers.RuntimeName + baseVM.Status.Network.Plugin = providers.NetworkPluginName + // Populate the runtime and network-plugin providers. + if err := config.SetAndPopulateProviders(providers.RuntimeName, providers.NetworkPluginName); err != nil { + return nil, err + } + // Set the passed image argument on the new VM spec. // Image is necessary while serializing the VM spec. if len(args) == 1 { diff --git a/cmd/ignite/run/import.go b/cmd/ignite/run/import.go index 881442f13..b9e415606 100644 --- a/cmd/ignite/run/import.go +++ b/cmd/ignite/run/import.go @@ -3,6 +3,7 @@ package run import ( api "github.com/weaveworks/ignite/pkg/apis/ignite" meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" + "github.com/weaveworks/ignite/pkg/config" "github.com/weaveworks/ignite/pkg/metadata" "github.com/weaveworks/ignite/pkg/operations" "github.com/weaveworks/ignite/pkg/providers" @@ -10,6 +11,11 @@ import ( ) func ImportImage(source string) (image *api.Image, err error) { + // Populate the runtime provider. + if err := config.SetAndPopulateProviders(providers.RuntimeName, providers.NetworkPluginName); err != nil { + return nil, err + } + ociRef, err := meta.NewOCIImageRef(source) if err != nil { return @@ -27,6 +33,11 @@ func ImportImage(source string) (image *api.Image, err error) { } func ImportKernel(source string) (kernel *api.Kernel, err error) { + // Populate the runtime provider. + if err := config.SetAndPopulateProviders(providers.RuntimeName, providers.NetworkPluginName); err != nil { + return nil, err + } + ociRef, err := meta.NewOCIImageRef(source) if err != nil { return diff --git a/cmd/ignite/run/logs.go b/cmd/ignite/run/logs.go index 027dc73c8..9d349ad35 100644 --- a/cmd/ignite/run/logs.go +++ b/cmd/ignite/run/logs.go @@ -5,6 +5,7 @@ import ( "io/ioutil" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/config" "github.com/weaveworks/ignite/pkg/providers" "github.com/weaveworks/ignite/pkg/util" ) @@ -25,6 +26,11 @@ func Logs(lo *LogsOptions) error { return fmt.Errorf("VM %q is not running", lo.vm.GetUID()) } + // Set the runtime and network-plugin providers from the VM status. + if err := config.SetAndPopulateProviders(lo.vm.Status.Runtime.Name, lo.vm.Status.Network.Plugin); err != nil { + return err + } + // Fetch the VM logs rc, err := providers.Runtime.ContainerLogs(util.NewPrefixer().Prefix(lo.vm.GetUID())) if err != nil { diff --git a/cmd/ignite/run/rm.go b/cmd/ignite/run/rm.go index 9cee46d8e..43e201c8b 100644 --- a/cmd/ignite/run/rm.go +++ b/cmd/ignite/run/rm.go @@ -5,6 +5,7 @@ import ( api "github.com/weaveworks/ignite/pkg/apis/ignite" "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" + "github.com/weaveworks/ignite/pkg/config" "github.com/weaveworks/ignite/pkg/operations" "github.com/weaveworks/ignite/pkg/providers" ) @@ -60,6 +61,14 @@ func Rm(ro *RmOptions) error { return fmt.Errorf("%s is running", vm.GetUID()) } + // Runtime and network info are present only when the VM is running. + if vm.Running() { + // Set the runtime and network-plugin providers from the VM status. + if err := config.SetAndPopulateProviders(vm.Status.Runtime.Name, vm.Status.Network.Plugin); err != nil { + return err + } + } + // This will first kill the VM container, and then remove it if err := operations.DeleteVM(providers.Client, vm); err != nil { return err diff --git a/cmd/ignite/run/start.go b/cmd/ignite/run/start.go index dc04cb87a..502952e40 100644 --- a/cmd/ignite/run/start.go +++ b/cmd/ignite/run/start.go @@ -8,9 +8,11 @@ import ( log "github.com/sirupsen/logrus" "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/config" "github.com/weaveworks/ignite/pkg/constants" "github.com/weaveworks/ignite/pkg/operations" "github.com/weaveworks/ignite/pkg/preflight/checkers" + "github.com/weaveworks/ignite/pkg/providers" "github.com/weaveworks/ignite/pkg/util" "golang.org/x/crypto/ssh" "k8s.io/apimachinery/pkg/util/sets" @@ -45,6 +47,17 @@ func Start(so *StartOptions) error { return fmt.Errorf("VM %q is already running", so.vm.GetUID()) } + // In case the runtime and network-plugin is specified explicitly at start, + // set the runtime and network-plugin on the VM. This overrides the global + // config and config on the VM object, if any. + so.vm.Status.Runtime.Name = providers.RuntimeName + so.vm.Status.Network.Plugin = providers.NetworkPluginName + + // Set the runtime and network-plugin providers from the VM status. + if err := config.SetAndPopulateProviders(so.vm.Status.Runtime.Name, so.vm.Status.Network.Plugin); err != nil { + return err + } + ignoredPreflightErrors := sets.NewString(util.ToLower(so.StartFlags.IgnoredPreflightErrors)...) if err := checkers.StartCmdChecks(so.vm, ignoredPreflightErrors); err != nil { return err diff --git a/cmd/ignite/run/stop.go b/cmd/ignite/run/stop.go index c2fe10b68..9dbe3241a 100644 --- a/cmd/ignite/run/stop.go +++ b/cmd/ignite/run/stop.go @@ -2,6 +2,7 @@ package run import ( api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/config" "github.com/weaveworks/ignite/pkg/operations" ) @@ -22,6 +23,11 @@ func (sf *StopFlags) NewStopOptions(vmMatches []string) (so *StopOptions, err er func Stop(so *StopOptions) error { for _, vm := range so.vms { + // Set the runtime and network-plugin providers from the VM status. + if err := config.SetAndPopulateProviders(vm.Status.Runtime.Name, vm.Status.Network.Plugin); err != nil { + return err + } + // Stop the VM, and optionally kill it if err := operations.StopVM(vm, so.Kill, false); err != nil { return err diff --git a/docs/cli/ignite/ignite.md b/docs/cli/ignite/ignite.md index 286532ebb..2e569fdb8 100644 --- a/docs/cli/ignite/ignite.md +++ b/docs/cli/ignite/ignite.md @@ -33,12 +33,10 @@ Example usage: ### Options ``` - -h, --help help for ignite - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + -h, --help help for ignite + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_attach.md b/docs/cli/ignite/ignite_attach.md index 1771b9e4c..5add0dad1 100644 --- a/docs/cli/ignite/ignite_attach.md +++ b/docs/cli/ignite/ignite_attach.md @@ -23,11 +23,9 @@ ignite attach [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_completion.md b/docs/cli/ignite/ignite_completion.md index f8f978422..6eb0ad80b 100644 --- a/docs/cli/ignite/ignite_completion.md +++ b/docs/cli/ignite/ignite_completion.md @@ -27,11 +27,9 @@ ignite completion [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_cp.md b/docs/cli/ignite/ignite_cp.md index 2697705a5..885e083f5 100644 --- a/docs/cli/ignite/ignite_cp.md +++ b/docs/cli/ignite/ignite_cp.md @@ -31,11 +31,9 @@ ignite cp [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_create.md b/docs/cli/ignite/ignite_create.md index 65eb87838..7a085fdc6 100644 --- a/docs/cli/ignite/ignite_create.md +++ b/docs/cli/ignite/ignite_create.md @@ -43,8 +43,10 @@ ignite create [flags] -l, --label stringArray Set a label (foo=bar) --memory size Amount of RAM to allocate for the VM (default 512.0 MB) -n, --name string Specify the name + --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) -p, --ports strings Map host ports to VM ports --require-name Require VM name to be passed, no name generation + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) -s, --size size VM filesystem size, for example 5GB or 2048MB (default 4.0 GB) --ssh[=] Enable SSH for the VM. If is given, it will be imported as the public key. If just '--ssh' is specified, a new keypair will be generated. (default is unset, which disables SSH access to the VM) @@ -54,11 +56,9 @@ ignite create [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_exec.md b/docs/cli/ignite/ignite_exec.md index 180d9baf4..374ce6dfc 100644 --- a/docs/cli/ignite/ignite_exec.md +++ b/docs/cli/ignite/ignite_exec.md @@ -27,11 +27,9 @@ ignite exec [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_image.md b/docs/cli/ignite/ignite_image.md index 4f2b26d1e..b86bbc094 100644 --- a/docs/cli/ignite/ignite_image.md +++ b/docs/cli/ignite/ignite_image.md @@ -22,11 +22,9 @@ ignite image [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_image_import.md b/docs/cli/ignite/ignite_image_import.md index 11c2b7a57..749ba4384 100644 --- a/docs/cli/ignite/ignite_image_import.md +++ b/docs/cli/ignite/ignite_image_import.md @@ -17,17 +17,16 @@ ignite image import [flags] ### Options ``` - -h, --help help for import + -h, --help help for import + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) ``` ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_image_ls.md b/docs/cli/ignite/ignite_image_ls.md index 0325f35c7..4a0b2338a 100644 --- a/docs/cli/ignite/ignite_image_ls.md +++ b/docs/cli/ignite/ignite_image_ls.md @@ -21,11 +21,9 @@ ignite image ls [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_image_rm.md b/docs/cli/ignite/ignite_image_rm.md index 1d4534806..b4746907e 100644 --- a/docs/cli/ignite/ignite_image_rm.md +++ b/docs/cli/ignite/ignite_image_rm.md @@ -24,11 +24,9 @@ ignite image rm ... [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_inspect.md b/docs/cli/ignite/ignite_inspect.md index 96eb19158..736de048e 100644 --- a/docs/cli/ignite/ignite_inspect.md +++ b/docs/cli/ignite/ignite_inspect.md @@ -35,11 +35,9 @@ ignite inspect [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_kernel.md b/docs/cli/ignite/ignite_kernel.md index dc3da31ca..32155db32 100644 --- a/docs/cli/ignite/ignite_kernel.md +++ b/docs/cli/ignite/ignite_kernel.md @@ -22,11 +22,9 @@ ignite kernel [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_kernel_import.md b/docs/cli/ignite/ignite_kernel_import.md index 470333483..74b879cd4 100644 --- a/docs/cli/ignite/ignite_kernel_import.md +++ b/docs/cli/ignite/ignite_kernel_import.md @@ -17,17 +17,16 @@ ignite kernel import [flags] ### Options ``` - -h, --help help for import + -h, --help help for import + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) ``` ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_kernel_ls.md b/docs/cli/ignite/ignite_kernel_ls.md index f38ec919a..edd243ba3 100644 --- a/docs/cli/ignite/ignite_kernel_ls.md +++ b/docs/cli/ignite/ignite_kernel_ls.md @@ -21,11 +21,9 @@ ignite kernel ls [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_kernel_rm.md b/docs/cli/ignite/ignite_kernel_rm.md index 512030806..fa57080ea 100644 --- a/docs/cli/ignite/ignite_kernel_rm.md +++ b/docs/cli/ignite/ignite_kernel_rm.md @@ -24,11 +24,9 @@ ignite kernel rm ... [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_kill.md b/docs/cli/ignite/ignite_kill.md index 438b782bf..8cd3cfc4c 100644 --- a/docs/cli/ignite/ignite_kill.md +++ b/docs/cli/ignite/ignite_kill.md @@ -23,11 +23,9 @@ ignite kill ... [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_logs.md b/docs/cli/ignite/ignite_logs.md index ad364c3e4..6c4a3abc3 100644 --- a/docs/cli/ignite/ignite_logs.md +++ b/docs/cli/ignite/ignite_logs.md @@ -22,11 +22,9 @@ ignite logs [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_ps.md b/docs/cli/ignite/ignite_ps.md index 4f9f919f2..53fe92191 100644 --- a/docs/cli/ignite/ignite_ps.md +++ b/docs/cli/ignite/ignite_ps.md @@ -47,11 +47,9 @@ ignite ps [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_rm.md b/docs/cli/ignite/ignite_rm.md index d00f5cc96..d7bc058ce 100644 --- a/docs/cli/ignite/ignite_rm.md +++ b/docs/cli/ignite/ignite_rm.md @@ -26,11 +26,9 @@ ignite rm ... [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_rmi.md b/docs/cli/ignite/ignite_rmi.md index 2df632b7c..5489d2706 100644 --- a/docs/cli/ignite/ignite_rmi.md +++ b/docs/cli/ignite/ignite_rmi.md @@ -24,11 +24,9 @@ ignite rmi [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_rmk.md b/docs/cli/ignite/ignite_rmk.md index f66a811b7..ec6f9a458 100644 --- a/docs/cli/ignite/ignite_rmk.md +++ b/docs/cli/ignite/ignite_rmk.md @@ -24,11 +24,9 @@ ignite rmk [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_run.md b/docs/cli/ignite/ignite_run.md index d91c481d2..8b48ac91b 100644 --- a/docs/cli/ignite/ignite_run.md +++ b/docs/cli/ignite/ignite_run.md @@ -39,8 +39,10 @@ ignite run [flags] -l, --label stringArray Set a label (foo=bar) --memory size Amount of RAM to allocate for the VM (default 512.0 MB) -n, --name string Specify the name + --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) -p, --ports strings Map host ports to VM ports --require-name Require VM name to be passed, no name generation + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) -s, --size size VM filesystem size, for example 5GB or 2048MB (default 4.0 GB) --ssh[=] Enable SSH for the VM. If is given, it will be imported as the public key. If just '--ssh' is specified, a new keypair will be generated. (default is unset, which disables SSH access to the VM) @@ -50,11 +52,9 @@ ignite run [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_ssh.md b/docs/cli/ignite/ignite_ssh.md index 8a0b6d6d6..0fa577395 100644 --- a/docs/cli/ignite/ignite_ssh.md +++ b/docs/cli/ignite/ignite_ssh.md @@ -27,11 +27,9 @@ ignite ssh [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_start.md b/docs/cli/ignite/ignite_start.md index 9124c271f..00eef2ebb 100644 --- a/docs/cli/ignite/ignite_start.md +++ b/docs/cli/ignite/ignite_start.md @@ -21,16 +21,16 @@ ignite start [flags] -h, --help help for start --ignore-preflight-checks strings A list of checks whose errors will be shown as warnings. Example: 'BinaryInPath,Port,ExistingFile'. Value 'all' ignores errors from all checks. -i, --interactive Attach to the VM after starting + --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) ``` ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_stop.md b/docs/cli/ignite/ignite_stop.md index da4571332..bf22a0310 100644 --- a/docs/cli/ignite/ignite_stop.md +++ b/docs/cli/ignite/ignite_stop.md @@ -28,11 +28,9 @@ ignite stop ... [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_version.md b/docs/cli/ignite/ignite_version.md index 394956207..9e8ffc40b 100644 --- a/docs/cli/ignite/ignite_version.md +++ b/docs/cli/ignite/ignite_version.md @@ -20,11 +20,9 @@ ignite version [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm.md b/docs/cli/ignite/ignite_vm.md index 144ac2c87..e33c0ef6b 100644 --- a/docs/cli/ignite/ignite_vm.md +++ b/docs/cli/ignite/ignite_vm.md @@ -21,11 +21,9 @@ ignite vm [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_attach.md b/docs/cli/ignite/ignite_vm_attach.md index ff17e45f9..503db8037 100644 --- a/docs/cli/ignite/ignite_vm_attach.md +++ b/docs/cli/ignite/ignite_vm_attach.md @@ -23,11 +23,9 @@ ignite vm attach [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_create.md b/docs/cli/ignite/ignite_vm_create.md index bfe0e5bd0..df9277e20 100644 --- a/docs/cli/ignite/ignite_vm_create.md +++ b/docs/cli/ignite/ignite_vm_create.md @@ -43,8 +43,10 @@ ignite vm create [flags] -l, --label stringArray Set a label (foo=bar) --memory size Amount of RAM to allocate for the VM (default 512.0 MB) -n, --name string Specify the name + --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) -p, --ports strings Map host ports to VM ports --require-name Require VM name to be passed, no name generation + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) -s, --size size VM filesystem size, for example 5GB or 2048MB (default 4.0 GB) --ssh[=] Enable SSH for the VM. If is given, it will be imported as the public key. If just '--ssh' is specified, a new keypair will be generated. (default is unset, which disables SSH access to the VM) @@ -54,11 +56,9 @@ ignite vm create [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_kill.md b/docs/cli/ignite/ignite_vm_kill.md index a8fa00bbc..8b43db254 100644 --- a/docs/cli/ignite/ignite_vm_kill.md +++ b/docs/cli/ignite/ignite_vm_kill.md @@ -23,11 +23,9 @@ ignite vm kill ... [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_logs.md b/docs/cli/ignite/ignite_vm_logs.md index bb6699c67..3b490bc16 100644 --- a/docs/cli/ignite/ignite_vm_logs.md +++ b/docs/cli/ignite/ignite_vm_logs.md @@ -22,11 +22,9 @@ ignite vm logs [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_ps.md b/docs/cli/ignite/ignite_vm_ps.md index 378f050c5..420d08558 100644 --- a/docs/cli/ignite/ignite_vm_ps.md +++ b/docs/cli/ignite/ignite_vm_ps.md @@ -47,11 +47,9 @@ ignite vm ps [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_rm.md b/docs/cli/ignite/ignite_vm_rm.md index 1ddb64f4d..441fde045 100644 --- a/docs/cli/ignite/ignite_vm_rm.md +++ b/docs/cli/ignite/ignite_vm_rm.md @@ -26,11 +26,9 @@ ignite vm rm ... [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_run.md b/docs/cli/ignite/ignite_vm_run.md index f53fbed61..ec0a87b31 100644 --- a/docs/cli/ignite/ignite_vm_run.md +++ b/docs/cli/ignite/ignite_vm_run.md @@ -39,8 +39,10 @@ ignite vm run [flags] -l, --label stringArray Set a label (foo=bar) --memory size Amount of RAM to allocate for the VM (default 512.0 MB) -n, --name string Specify the name + --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) -p, --ports strings Map host ports to VM ports --require-name Require VM name to be passed, no name generation + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) --sandbox-image oci-image Specify an OCI image for the VM sandbox (default weaveworks/ignite:dev) -s, --size size VM filesystem size, for example 5GB or 2048MB (default 4.0 GB) --ssh[=] Enable SSH for the VM. If is given, it will be imported as the public key. If just '--ssh' is specified, a new keypair will be generated. (default is unset, which disables SSH access to the VM) @@ -50,11 +52,9 @@ ignite vm run [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_ssh.md b/docs/cli/ignite/ignite_vm_ssh.md index ddda7f8d4..4e49f4c89 100644 --- a/docs/cli/ignite/ignite_vm_ssh.md +++ b/docs/cli/ignite/ignite_vm_ssh.md @@ -27,11 +27,9 @@ ignite vm ssh [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_start.md b/docs/cli/ignite/ignite_vm_start.md index 52cf6d272..b6fe63271 100644 --- a/docs/cli/ignite/ignite_vm_start.md +++ b/docs/cli/ignite/ignite_vm_start.md @@ -21,16 +21,16 @@ ignite vm start [flags] -h, --help help for start --ignore-preflight-checks strings A list of checks whose errors will be shown as warnings. Example: 'BinaryInPath,Port,ExistingFile'. Value 'all' ignores errors from all checks. -i, --interactive Attach to the VM after starting + --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) + --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) ``` ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/docs/cli/ignite/ignite_vm_stop.md b/docs/cli/ignite/ignite_vm_stop.md index 59f7228f5..4896272af 100644 --- a/docs/cli/ignite/ignite_vm_stop.md +++ b/docs/cli/ignite/ignite_vm_stop.md @@ -28,11 +28,9 @@ ignite vm stop ... [flags] ### Options inherited from parent commands ``` - --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details - --log-level loglevel Specify the loglevel for the program (default info) - --network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni) - -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs - --runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd) + --ignite-config string Ignite configuration path; refer to the 'Ignite Configuration' docs for more details + --log-level loglevel Specify the loglevel for the program (default info) + -q, --quiet The quiet mode allows for machine-parsable output by printing only IDs ``` ### SEE ALSO diff --git a/e2e/run_test.go b/e2e/run_test.go index 2c9094ccb..08adaae89 100644 --- a/e2e/run_test.go +++ b/e2e/run_test.go @@ -23,8 +23,6 @@ func runWithRuntimeAndNetworkPlugin(t *testing.T, vmName, runtime, networkPlugin igniteCmd := util.NewCommand(t, igniteBin) defer igniteCmd.New(). - WithRuntime(runtime). - WithNetwork(networkPlugin). With("rm", "-f"). With(vmName). Run() @@ -73,8 +71,6 @@ func runCurl(t *testing.T, vmName, runtime, networkPlugin string) { igniteCmd := util.NewCommand(t, igniteBin) defer igniteCmd.New(). - WithRuntime(runtime). - WithNetwork(networkPlugin). With("rm", "-f", vmName). Run() diff --git a/e2e/run_volume_test.go b/e2e/run_volume_test.go index 1f1d6397a..caeb0887e 100644 --- a/e2e/run_volume_test.go +++ b/e2e/run_volume_test.go @@ -73,8 +73,6 @@ func runVolume(t *testing.T, vmName, runtime, networkPlugin string) { // Clean-up the following VM. defer igniteCmd.New(). - WithRuntime(runtime). - WithNetwork(networkPlugin). With("rm", "-f", vmName). Run() @@ -97,8 +95,6 @@ func runVolume(t *testing.T, vmName, runtime, networkPlugin string) { // Stop the vm without force. igniteCmd.New(). - WithRuntime(runtime). - WithNetwork(networkPlugin). With("stop", vmName). Run() @@ -106,8 +102,6 @@ func runVolume(t *testing.T, vmName, runtime, networkPlugin string) { // Clean-up the following VM. defer igniteCmd.New(). - WithRuntime(runtime). - WithNetwork(networkPlugin). With("rm", "-f", secondVMName). Run() diff --git a/e2e/vm_lifecycle_test.go b/e2e/vm_lifecycle_test.go new file mode 100644 index 000000000..e4a5d1830 --- /dev/null +++ b/e2e/vm_lifecycle_test.go @@ -0,0 +1,133 @@ +package e2e + +import ( + "testing" + + "github.com/weaveworks/ignite/e2e/util" + "gotest.tools/assert" +) + +// runVMLifecycle is a helper for testing the VM lifecycle. +// vmName should be unique for each test. +func runVMLifecycle(t *testing.T, vmName, runtime, networkPlugin string) { + assert.Assert(t, e2eHome != "", "IGNITE_E2E_HOME should be set") + + igniteCmd := util.NewCommand(t, igniteBin) + + // Clean-up the following VM. + defer igniteCmd.New(). + With("rm", "-f", vmName). + Run() + + // Run VM. + igniteCmd.New(). + WithRuntime(runtime). + WithNetwork(networkPlugin). + With("run"). + With("--name=" + vmName). + With("--ssh"). + With(util.DefaultVMImage). + Run() + + // Check network access. + igniteCmd.New(). + With("exec", vmName). + With("curl", "google.com"). + Run() + + // Stop VM. + igniteCmd.New(). + With("stop", vmName). + Run() + + // Start VM with explicit runtime and network because these info are + // removed when VM is stopped. Without it, the VM will start with the + // default provider configurations. + igniteCmd.New(). + With("start", vmName). + WithRuntime(runtime). + WithNetwork(networkPlugin). + Run() + + // Check network access after reboot. + igniteCmd.New(). + With("exec", vmName). + With("curl", "google.com"). + Run() +} + +func TestVMLifecycleWithDockerAndDockerBridge(t *testing.T) { + runVMLifecycle( + t, + "e2e_test_vm_lifecycle_docker_and_docker_bridge", + "docker", + "docker-bridge", + ) +} + +func TestVMLifecycleWithDockerAndCNI(t *testing.T) { + runVMLifecycle( + t, + "e2e_test_vm_lifecycle_docker_and_cni", + "docker", + "cni", + ) +} + +func TestVMLifecycleWithContainerdAndCNI(t *testing.T) { + runVMLifecycle( + t, + "e2e_test_vm_lifecycle_containerd_and_cni", + "containerd", + "cni", + ) +} + +// TestVMProviderSwitch tests that a VM's runtime and network-plugin can be +// changed. +func TestVMProviderSwitch(t *testing.T) { + assert.Assert(t, e2eHome != "", "IGNITE_E2E_HOME should be set") + + vmName := "e2e_test_vm_providers_switch" + + igniteCmd := util.NewCommand(t, igniteBin) + + // Clean-up the following VM. + defer igniteCmd.New(). + With("rm", "-f", vmName). + Run() + + // Run VM. + igniteCmd.New(). + WithRuntime("containerd"). + WithNetwork("cni"). + With("run"). + With("--name=" + vmName). + With("--ssh"). + With(util.DefaultVMImage). + Run() + + // Check network access. + igniteCmd.New(). + With("exec", vmName). + With("curl", "google.com"). + Run() + + // Stop VM. + igniteCmd.New(). + With("stop", vmName). + Run() + + // Start VM with different providers. + igniteCmd.New(). + With("start", vmName). + WithRuntime("docker"). + WithNetwork("docker-bridge"). + Run() + + // Check network access. + igniteCmd.New(). + With("exec", vmName). + With("curl", "google.com"). + Run() +} diff --git a/pkg/config/config.go b/pkg/config/config.go index b66f593dc..22ea434ec 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -11,6 +11,7 @@ import ( "github.com/weaveworks/ignite/pkg/constants" "github.com/weaveworks/ignite/pkg/network" "github.com/weaveworks/ignite/pkg/providers" + "github.com/weaveworks/ignite/pkg/providers/ignite" "github.com/weaveworks/ignite/pkg/runtime" ) @@ -79,3 +80,10 @@ func getConfigFromFile(configPath string) (*api.Configuration, error) { return componentConfig, nil } + +// SetAndPopulateProviders sets and populates the providers. +func SetAndPopulateProviders(runtimeName runtime.Name, networkPlugin network.PluginName) error { + providers.RuntimeName = runtimeName + providers.NetworkPluginName = networkPlugin + return providers.Populate(ignite.Providers) +} diff --git a/pkg/operations/remove.go b/pkg/operations/remove.go index 2786c254e..604549845 100644 --- a/pkg/operations/remove.go +++ b/pkg/operations/remove.go @@ -20,28 +20,31 @@ const ( // DeleteVM removes the specified VM from the Client and performs a cleanup func DeleteVM(c *client.Client, vm *api.VM) error { - if err := c.VMs().Delete(vm.GetUID()); err != nil { + if err := CleanupVM(vm); err != nil { return err } - return CleanupVM(vm) + return c.VMs().Delete(vm.GetUID()) } // CleanupVM removes the resources of the given VM func CleanupVM(vm *api.VM) error { - // Inspect the container before trying to stop it and it gets auto-removed - inspectResult, _ := providers.Runtime.InspectContainer(util.NewPrefixer().Prefix(vm.GetUID())) - - // If the VM is running, try to kill it first so we don't leave dangling containers. Otherwise, try to cleanup VM networking. - if err := StopVM(vm, true, true); err != nil { - if vm.Running() { - return err + // Runtime information is available only when the VM is running. + if vm.Running() { + // Inspect the container before trying to stop it and it gets auto-removed + inspectResult, _ := providers.Runtime.InspectContainer(util.NewPrefixer().Prefix(vm.GetUID())) + + // If the VM is running, try to kill it first so we don't leave dangling containers. Otherwise, try to cleanup VM networking. + if err := StopVM(vm, true, true); err != nil { + if vm.Running() { + return err + } } - } - // Remove the VM container if it exists - // TODO should this function return a proper error? - RemoveVMContainer(inspectResult) + // Remove the VM container if it exists + // TODO should this function return a proper error? + RemoveVMContainer(inspectResult) + } // After removing the VM container, if the Snapshot Device is still there, clean up if _, err := os.Stat(vm.SnapshotDev()); err == nil {