-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8604 from mheon/volume_plugin_impl
Initial implementation of volume plugins
- Loading branch information
Showing
34 changed files
with
1,029 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM golang:1.15-alpine AS build-img | ||
COPY ./test/testvol/ /go/src/github.com/containers/podman/cmd/testvol/ | ||
COPY ./vendor /go/src/github.com/containers/podman/vendor/ | ||
WORKDIR /go/src/github.com/containers/podman | ||
RUN go build -o /testvol ./cmd/testvol | ||
|
||
FROM alpine | ||
COPY --from=build-img /testvol /usr/local/bin | ||
WORKDIR / | ||
ENTRYPOINT ["/usr/local/bin/testvol"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ driver options can be set using the **--opt** flag. | |
|
||
#### **--driver**=*driver* | ||
|
||
Specify the volume driver name (default local). | ||
Specify the volume driver name (default **local**). Setting this to a value other than **local** Podman will attempt to create the volume using a volume plugin with the given name. Such plugins must be defined in the **volume_plugins** section of the **containers.conf**(5) configuration file. | ||
|
||
#### **--help** | ||
|
||
|
@@ -30,13 +30,14 @@ Set metadata for a volume (e.g., --label mykey=value). | |
#### **--opt**=*option*, **-o** | ||
|
||
Set driver specific options. | ||
For the default driver, `local`, this allows a volume to be configured to mount a filesystem on the host. | ||
For the default driver, **local**, this allows a volume to be configured to mount a filesystem on the host. | ||
For the `local` driver the following options are supported: `type`, `device`, and `o`. | ||
The `type` option sets the type of the filesystem to be mounted, and is equivalent to the `-t` flag to **mount(8)**. | ||
The `device` option sets the device to be mounted, and is equivalent to the `device` argument to **mount(8)**. | ||
The `o` option sets options for the mount, and is equivalent to the `-o` flag to **mount(8)** with two exceptions. | ||
The `o` option supports `uid` and `gid` options to set the UID and GID of the created volume that are not normally supported by **mount(8)**. | ||
Using volume options with the `local` driver requires root privileges. | ||
Using volume options with the **local** driver requires root privileges. | ||
When not using the **local** driver, the given options will be passed directly to the volume plugin. In this case, supported options will be dictated by the plugin in question, not Podman. | ||
|
||
## EXAMPLES | ||
|
||
|
@@ -53,7 +54,8 @@ $ podman volume create --label foo=bar myvol | |
``` | ||
|
||
## SEE ALSO | ||
podman-volume(1), mount(8) | ||
**podman-volume**(1), **mount**(8), **containers.conf**(5) | ||
|
||
## HISTORY | ||
January 2020, updated with information on volume plugins by Matthew Heon <[email protected]> | ||
November 2018, Originally compiled by Urvashi Mohnani <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package define | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
// InspectVolumeData is the output of Inspect() on a volume. It is matched to | ||
// the format of 'docker volume inspect'. | ||
type InspectVolumeData struct { | ||
// Name is the name of the volume. | ||
Name string `json:"Name"` | ||
// Driver is the driver used to create the volume. | ||
// If set to "local" or "", the Local driver (Podman built-in code) is | ||
// used to service the volume; otherwise, a volume plugin with the given | ||
// name is used to mount and manage the volume. | ||
Driver string `json:"Driver"` | ||
// Mountpoint is the path on the host where the volume is mounted. | ||
Mountpoint string `json:"Mountpoint"` | ||
// CreatedAt is the date and time the volume was created at. This is not | ||
// stored for older Libpod volumes; if so, it will be omitted. | ||
CreatedAt time.Time `json:"CreatedAt,omitempty"` | ||
// Status is used to return information on the volume's current state, | ||
// if the volume was created using a volume plugin (uses a Driver that | ||
// is not the local driver). | ||
// Status is provided to us by an external program, so no guarantees are | ||
// made about its format or contents. Further, it is an optional field, | ||
// so it may not be set even in cases where a volume plugin is in use. | ||
Status map[string]interface{} `json:"Status,omitempty"` | ||
// Labels includes the volume's configured labels, key:value pairs that | ||
// can be passed during volume creation to provide information for third | ||
// party tools. | ||
Labels map[string]string `json:"Labels"` | ||
// Scope is unused and provided solely for Docker compatibility. It is | ||
// unconditionally set to "local". | ||
Scope string `json:"Scope"` | ||
// Options is a set of options that were used when creating the volume. | ||
// For the Local driver, these are mount options that will be used to | ||
// determine how a local filesystem is mounted; they are handled as | ||
// parameters to Mount in a manner described in the volume create | ||
// manpage. | ||
// For non-local drivers, these are passed as-is to the volume plugin. | ||
Options map[string]string `json:"Options"` | ||
// UID is the UID that the volume was created with. | ||
UID int `json:"UID,omitempty"` | ||
// GID is the GID that the volume was created with. | ||
GID int `json:"GID,omitempty"` | ||
// Anonymous indicates that the volume was created as an anonymous | ||
// volume for a specific container, and will be be removed when any | ||
// container using it is removed. | ||
Anonymous bool `json:"Anonymous,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.