Files
warewulf/internal/app/wwctl/container/imprt/root.go
Christian Goll 2efcbe0348 syncucer will only write witrh syncuser switch
uid/gid are not synced at container import but checked. An apropriate
message is printed, regarding users which are not present on host.
The `wwctl container syncuser` needs the `--write` switch to actually
write to the container.

The command `wwctl container syncuser` will always operate at the
container level, but as the 'generic` overlay reads in the container
passwd/group, following two steps will update the passwd/group on a
running cluster:
1. Add passwd/group to container
wwctl container syncuser --write CONTAINER
2. Synchronize overlay
wwctl overlay build -N
2022-05-12 11:18:53 +02:00

42 lines
1.5 KiB
Go

package imprt
import "github.com/spf13/cobra"
var (
baseCmd = &cobra.Command{
DisableFlagsInUseLine: true,
Use: "import [OPTIONS] SOURCE [NAME]",
Short: "Import a container into Warewulf",
Long: `This command will pull and import a container into Warewulf from SOURCE,
optionally renaming it to NAME. The SOURCE must be in a supported URI format. Formats
are:
* docker://registry.example.org/example:latest
* docker-daemon://example:latest
* file://path/to/archive/tar/ball
* /path/to/archive/tar/ball
* /path/to/chroot/
Imported containers are used to create bootable VNFS images.`,
Example: "wwctl container import docker://warewulf/centos-8 my_container",
RunE: CobraRunE,
Args: cobra.MinimumNArgs(1),
}
SetForce bool
SetUpdate bool
SetBuild bool
SetDefault bool
SyncUser bool
)
func init() {
baseCmd.PersistentFlags().BoolVarP(&SetForce, "force", "f", false, "Force overwrite of an existing container")
baseCmd.PersistentFlags().BoolVarP(&SetUpdate, "update", "u", false, "Update and overwrite an existing container")
baseCmd.PersistentFlags().BoolVarP(&SetBuild, "build", "b", false, "Build container when after pulling")
baseCmd.PersistentFlags().BoolVar(&SetDefault, "setdefault", false, "Set this container for the default profile")
baseCmd.PersistentFlags().BoolVar(&SyncUser, "syncuser", false, "Synchronize uis/gods from host to container")
}
// GetRootCommand returns the root cobra.Command for the application.
func GetCommand() *cobra.Command {
return baseCmd
}