Skip to content

Commit

Permalink
We don't support VolumesFrom or links
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #118
Approved by: mheon
  • Loading branch information
rhatdan authored and rh-atomic-bot committed Dec 12, 2017
1 parent 7f5aa42 commit 88121e0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 97 deletions.
2 changes: 0 additions & 2 deletions cmd/kpod/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ type createConfig struct {
group uint32 // group
utsMode container.UTSMode //uts
volumes []string //volume
volumesFrom []string //volumes-from
workDir string //workdir
mountLabel string //SecurityOpts
processLabel string //SecurityOpts
Expand Down Expand Up @@ -478,7 +477,6 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er
user: uid,
group: gid,
volumes: c.StringSlice("volume"),
volumesFrom: c.StringSlice("volumes-from"),
workDir: c.String("workdir"),
}

Expand Down
30 changes: 0 additions & 30 deletions cmd/kpod/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,36 +449,6 @@ func validateMACAddress(val string) (string, error) { //nolint
return val, nil
}

// validateLink validates that the specified string has a valid link format (containerName:alias).
func validateLink(val string) (string, error) { //nolint
if _, _, err := parseLink(val); err != nil {
return val, err
}
return val, nil
}

// parseLink parses and validates the specified string as a link format (name:alias)
func parseLink(val string) (string, string, error) {
if val == "" {
return "", "", fmt.Errorf("empty string specified for links")
}
arr := strings.Split(val, ":")
if len(arr) > 2 {
return "", "", fmt.Errorf("bad format for links: %s", val)
}
if len(arr) == 1 {
return val, val, nil
}
// This is kept because we can actually get a HostConfig with links
// from an already created container and the format is not `foo:bar`
// but `/foo:/c1/bar`
if strings.HasPrefix(arr[0], "/") {
_, alias := path.Split(arr[1])
return arr[0][1:], alias, nil
}
return arr[0], arr[1], nil
}

// parseLoggingOpts validates the logDriver and logDriverOpts
// for log-opt and log-driver flags
func parseLoggingOpts(logDriver string, logDriverOpt []string) (map[string]string, error) { //nolint
Expand Down
26 changes: 3 additions & 23 deletions docs/kpod-create.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,8 @@ unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap.

kpod generates a UUID for each container, and if a name is not assigned
to the container with **--name** then the daemon will also generate a random
string name. The name is useful when defining links (see **--link**) (or any
other place you need to identify a container). This works for both background
and foreground containers.
string name. The name is useful any place you need to identify a container.
This works for both background and foreground containers.

**--network**="*bridge*"
Set the Network mode for the container
Expand Down Expand Up @@ -498,8 +497,7 @@ must be an absolute path as well. kpod bind-mounts the `HOST-DIR` to the
path you specify. For example, if you supply the `/foo` value, kpod creates a bind-mount.

You can specify multiple **-v** options to mount one or more mounts to a
container. To use these same mounts in other containers, specify the
**--volumes-from** option also.
container.

You can add `:ro` or `:rw` suffix to a volume to mount it read-only or
read-write mode, respectively. By default, the volumes are mounted read-write.
Expand Down Expand Up @@ -552,24 +550,6 @@ change propagation properties of source mount. Say `/` is source mount for
To disable automatic copying of data from the container path to the volume, use
the `nocopy` flag. The `nocopy` flag can be set on bind mounts and named volumes.

**--volumes-from**=[]
Mount volumes from the specified container(s)

Mounts already mounted volumes from a source container onto another
container. You must supply the source's container-id. To share
a volume, use the **--volumes-from** option when running
the target container. You can share volumes even if the source container
is not running.

By default, kpod mounts the volumes in the same mode (read-write or
read-only) as it is mounted in the source container. Optionally, you
can change this by suffixing the container-id with either the `:ro` or
`:rw ` keyword.

If the location of the volume from the source container overlaps with
data residing on a target container, then the volume hides
that data on the target.

**-w**, **--workdir**=""
Working directory inside the container

Expand Down
45 changes: 3 additions & 42 deletions docs/kpod-run.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,8 @@ unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap.

kpod generates a UUID for each container, and if a name is not assigned
to the container with **--name** then the daemon will also generate a random
string name. The name is useful when defining links (see **--link**) (or any
other place you need to identify a container). This works for both background
and foreground containers.
string name. The name is useful any place you need to identify a container.
This works for both background and foreground containers.

**--network**="*bridge*"
Set the Network mode for the container
Expand Down Expand Up @@ -503,8 +502,7 @@ must be an absolute path as well. kpod bind-mounts the `HOST-DIR` to the
path you specify. For example, if you supply the `/foo` value, kpod creates a bind-mount.

You can specify multiple **-v** options to mount one or more mounts to a
container. To use these same mounts in other containers, specify the
**--volumes-from** option also.
container.

You can add `:ro` or `:rw` suffix to a volume to mount it read-only or
read-write mode, respectively. By default, the volumes are mounted read-write.
Expand Down Expand Up @@ -557,24 +555,6 @@ change propagation properties of source mount. Say `/` is source mount for
To disable automatic copying of data from the container path to the volume, use
the `nocopy` flag. The `nocopy` flag can be set on bind mounts and named volumes.

**--volumes-from**=[]
Mount volumes from the specified container(s)

Mounts already mounted volumes from a source container onto another
container. You must supply the source's container-id. To share
a volume, use the **--volumes-from** option when running
the target container. You can share volumes even if the source container
is not running.

By default, kpod mounts the volumes in the same mode (read-write or
read-only) as it is mounted in the source container. Optionally, you
can change this by suffixing the container-id with either the `:ro` or
`:rw ` keyword.

If the location of the volume from the source container overlaps with
data residing on a target container, then the volume hides
that data on the target.

**-w**, **--workdir**=""
Working directory inside the container

Expand Down Expand Up @@ -729,25 +709,6 @@ following:

# kpod run -p 8080:80 -d -i -t fedora/httpd

## Creating and Mounting a Data Volume Container

Many applications require the sharing of persistent data across several
containers. kpod allows you to create a Data Volume Container that other
containers can mount from. For example, create a named container that contains
directories /var/volume1 and /tmp/volume2. The image will need to contain these
directories so a couple of RUN mkdir instructions might be required for you
fedora-data image:

# kpod run --name=data -v /var/volume1 -v /tmp/volume2 -i -t fedora-data true
# kpod run --volumes-from=data --name=fedora-container1 -i -t fedora bash

Multiple --volumes-from parameters will bring together multiple data volumes from
multiple containers. And it's possible to mount the volumes that came from the
DATA container in yet another container via the fedora-container1 intermediary
container, allowing to abstract the actual data source from users of that data:

# kpod run --volumes-from=fedora-container1 --name=fedora-container2 -i -t fedora bash

## Mounting External Volumes

To mount a host directory as a container volume, specify the absolute path to
Expand Down

0 comments on commit 88121e0

Please sign in to comment.