mirror of
https://github.com/containers/podman.git
synced 2025-05-20 00:27:03 +08:00
Fix language. Mostly spelling a -> an
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
This commit is contained in:
@ -13,7 +13,7 @@ Unmounts the specified images' root file system, if no other processes
|
|||||||
are using it.
|
are using it.
|
||||||
|
|
||||||
Image storage increments a mount counter each time an image is mounted.
|
Image storage increments a mount counter each time an image is mounted.
|
||||||
When a image is unmounted, the mount counter is decremented, and the
|
When an image is unmounted, the mount counter is decremented, and the
|
||||||
image's root filesystem is physically unmounted only when the mount
|
image's root filesystem is physically unmounted only when the mount
|
||||||
counter reaches zero indicating no other processes are using the mount.
|
counter reaches zero indicating no other processes are using the mount.
|
||||||
An unmount can be forced with the --force flag.
|
An unmount can be forced with the --force flag.
|
||||||
|
@ -62,7 +62,7 @@ You can see the driver in the **podman network inspect** output under the `ipam_
|
|||||||
|
|
||||||
#### **--ipv6**
|
#### **--ipv6**
|
||||||
|
|
||||||
Enable IPv6 (Dual Stack) networking. If not subnets are given it will allocate a ipv4 and ipv6 subnet.
|
Enable IPv6 (Dual Stack) networking. If not subnets are given it will allocate an ipv4 and an ipv6 subnet.
|
||||||
|
|
||||||
#### **--label**
|
#### **--label**
|
||||||
|
|
||||||
|
@ -577,15 +577,15 @@ $ podman run -v data:/data2 -i -t fedora bash
|
|||||||
$ podman run -v /var/cache/dnf:/var/cache/dnf:O -ti fedora dnf -y update
|
$ podman run -v /var/cache/dnf:/var/cache/dnf:O -ti fedora dnf -y update
|
||||||
```
|
```
|
||||||
|
|
||||||
If the container needs a writeable mounted volume by a non root user inside the container, use the **U** option. This options tells Podman to chown the source volume to match the default UID and GID used within the container.
|
If the container needs a writeable mounted volume by a non root user inside the container, use the **U** option. This option tells Podman to chown the source volume to match the default UID and GID used within the container.
|
||||||
```
|
```
|
||||||
$ podman run -d -e MYSQL_ROOT_PASSWORD=root --user mysql --userns=keep-id -v ~/data:/var/lib/mysql:z,U mariadb
|
$ podman run -d -e MYSQL_ROOT_PASSWORD=root --user mysql --userns=keep-id -v ~/data:/var/lib/mysql:z,U mariadb
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternativley if the container needs a writable volume by a non root
|
Alternatively if the container needs a writable volume by a non root
|
||||||
user inside of the container, the --userns=keep-id option allows users to
|
user inside of the container, the --userns=keep-id option allows users to
|
||||||
specify the UID and GID of the user executing Podman to specific UIDs and GIDs
|
specify the UID and GID of the user executing Podman to specific UIDs and GIDs
|
||||||
within the container. Since the processes running in the container run as the users UID, they can read/write files owned by the user.
|
within the container. Since the processes running in the container run as the user's UID, they can read/write files owned by the user.
|
||||||
```
|
```
|
||||||
$ podman run -d -e MYSQL_ROOT_PASSWORD=root --user mysql --userns=keep-id:uid=999,gid=999 -v ~/data:/var/lib/mysql:z mariadb
|
$ podman run -d -e MYSQL_ROOT_PASSWORD=root --user mysql --userns=keep-id:uid=999,gid=999 -v ~/data:/var/lib/mysql:z mariadb
|
||||||
```
|
```
|
||||||
|
@ -244,7 +244,7 @@ type ContainerNamedVolume struct {
|
|||||||
IsAnonymous bool `json:"setAnonymous,omitempty"`
|
IsAnonymous bool `json:"setAnonymous,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerOverlayVolume is a overlay volume that will be mounted into the
|
// ContainerOverlayVolume is an overlay volume that will be mounted into the
|
||||||
// container. Each volume is a libpod Volume present in the state.
|
// container. Each volume is a libpod Volume present in the state.
|
||||||
type ContainerOverlayVolume struct {
|
type ContainerOverlayVolume struct {
|
||||||
// Destination is the absolute path where the mount will be placed in the container.
|
// Destination is the absolute path where the mount will be placed in the container.
|
||||||
|
@ -131,7 +131,7 @@ func (c *Container) validate() error {
|
|||||||
return fmt.Errorf("please set User explicitly via WithUser() instead of in OCI spec directly: %w", define.ErrInvalidArg)
|
return fmt.Errorf("please set User explicitly via WithUser() instead of in OCI spec directly: %w", define.ErrInvalidArg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init-ctrs must be used inside a Pod. Check if a init container type is
|
// Init-ctrs must be used inside a Pod. Check if an init container type is
|
||||||
// passed and if no pod is passed
|
// passed and if no pod is passed
|
||||||
if len(c.config.InitContainerType) > 0 && len(c.config.Pod) < 1 {
|
if len(c.config.InitContainerType) > 0 && len(c.config.Pod) < 1 {
|
||||||
return fmt.Errorf("init containers must be created in a pod: %w", define.ErrInvalidArg)
|
return fmt.Errorf("init containers must be created in a pod: %w", define.ErrInvalidArg)
|
||||||
|
@ -645,7 +645,7 @@ func (r *Runtime) ConnectContainerToNetwork(nameOrID, netName string, netOpts ty
|
|||||||
}
|
}
|
||||||
|
|
||||||
// normalizeNetworkName takes a network name, a partial or a full network ID and returns the network name.
|
// normalizeNetworkName takes a network name, a partial or a full network ID and returns the network name.
|
||||||
// If the network is not found a errors is returned.
|
// If the network is not found an error is returned.
|
||||||
func (r *Runtime) normalizeNetworkName(nameOrID string) (string, error) {
|
func (r *Runtime) normalizeNetworkName(nameOrID string) (string, error) {
|
||||||
net, err := r.network.NetworkInspect(nameOrID)
|
net, err := r.network.NetworkInspect(nameOrID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -368,7 +368,7 @@ func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {
|
|||||||
ns, err := ns.GetNS(path)
|
ns, err := ns.GetNS(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !new {
|
if !new {
|
||||||
// return a error if we could not get the namespace and should no create one
|
// return an error if we could not get the namespace and should no create one
|
||||||
return nil, fmt.Errorf("getting rootless network namespace: %w", err)
|
return nil, fmt.Errorf("getting rootless network namespace: %w", err)
|
||||||
}
|
}
|
||||||
// create a new namespace
|
// create a new namespace
|
||||||
@ -498,7 +498,7 @@ func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {
|
|||||||
return nil, fmt.Errorf("failed to create rootless netns resolv.conf: %w", err)
|
return nil, fmt.Errorf("failed to create rootless netns resolv.conf: %w", err)
|
||||||
}
|
}
|
||||||
// create cni directories to store files
|
// create cni directories to store files
|
||||||
// they will be bind mounted to the correct location in a extra mount ns
|
// they will be bind mounted to the correct location in an extra mount ns
|
||||||
err = os.MkdirAll(filepath.Join(rootlessNetNsDir, persistentCNIDir), 0700)
|
err = os.MkdirAll(filepath.Join(rootlessNetNsDir, persistentCNIDir), 0700)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("could not create rootless-netns var directory: %w", err)
|
return nil, fmt.Errorf("could not create rootless-netns var directory: %w", err)
|
||||||
|
@ -37,7 +37,7 @@ func (r *Runtime) setupNetNS(ctr *Container) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// normalizeNetworkName takes a network name, a partial or a full network ID and returns the network name.
|
// normalizeNetworkName takes a network name, a partial or a full network ID and returns the network name.
|
||||||
// If the network is not found a errors is returned.
|
// If the network is not found an error is returned.
|
||||||
func (r *Runtime) normalizeNetworkName(nameOrID string) (string, error) {
|
func (r *Runtime) normalizeNetworkName(nameOrID string) (string, error) {
|
||||||
return "", errors.New("not implemented (*Runtime) normalizeNetworkName")
|
return "", errors.New("not implemented (*Runtime) normalizeNetworkName")
|
||||||
}
|
}
|
||||||
|
@ -1842,7 +1842,7 @@ func WithHostUsers(hostUsers []string) CtrCreateOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithInitCtrType indicates the container is a initcontainer
|
// WithInitCtrType indicates the container is an initcontainer
|
||||||
func WithInitCtrType(containerType string) CtrCreateOption {
|
func WithInitCtrType(containerType string) CtrCreateOption {
|
||||||
return func(ctr *Container) error {
|
return func(ctr *Container) error {
|
||||||
if ctr.valid {
|
if ctr.valid {
|
||||||
|
@ -476,7 +476,7 @@ func makeRuntime(runtime *Runtime) (retErr error) {
|
|||||||
// Don't fatally error.
|
// Don't fatally error.
|
||||||
// This will allow us to ship configs including optional
|
// This will allow us to ship configs including optional
|
||||||
// runtimes that might not be installed (crun, kata).
|
// runtimes that might not be installed (crun, kata).
|
||||||
// Only a infof so default configs don't spec errors.
|
// Only an infof so default configs don't spec errors.
|
||||||
logrus.Debugf("Configured OCI runtime %s initialization failed: %v", name, err)
|
logrus.Debugf("Configured OCI runtime %s initialization failed: %v", name, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
|
|||||||
// container never created in OCI runtime
|
// container never created in OCI runtime
|
||||||
// docker parity: do nothing just return container id
|
// docker parity: do nothing just return container id
|
||||||
case errors.Is(err, define.ErrCtrStateInvalid):
|
case errors.Is(err, define.ErrCtrStateInvalid):
|
||||||
logrus.Debugf("Container %s is either not created on runtime or is in a invalid state", c.ID())
|
logrus.Debugf("Container %s is either not created on runtime or is in an invalid state", c.ID())
|
||||||
default:
|
default:
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ func (ic *ContainerEngine) NetworkRm(ctx context.Context, namesOrIds []string, o
|
|||||||
return reports, fmt.Errorf("%q has associated containers with it. Use -f to forcibly delete containers and pods: %w", name, define.ErrNetworkInUse)
|
return reports, fmt.Errorf("%q has associated containers with it. Use -f to forcibly delete containers and pods: %w", name, define.ErrNetworkInUse)
|
||||||
}
|
}
|
||||||
if c.IsInfra() {
|
if c.IsInfra() {
|
||||||
// if we have a infra container we need to remove the pod
|
// if we have an infra container we need to remove the pod
|
||||||
pod, err := ic.Libpod.GetPod(c.PodID())
|
pod, err := ic.Libpod.GetPod(c.PodID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return reports, err
|
return reports, err
|
||||||
|
@ -1190,7 +1190,7 @@ const (
|
|||||||
// or a string representing a sub-field or item. The string will follow one of these four formats:
|
// or a string representing a sub-field or item. The string will follow one of these four formats:
|
||||||
// 'f:<name>', where <name> is the name of a field in a struct, or key in a map
|
// 'f:<name>', where <name> is the name of a field in a struct, or key in a map
|
||||||
// 'v:<value>', where <value> is the exact json formatted value of a list item
|
// 'v:<value>', where <value> is the exact json formatted value of a list item
|
||||||
// 'i:<index>', where <index> is position of a item in a list
|
// 'i:<index>', where <index> is position of an item in a list
|
||||||
// 'k:<keys>', where <keys> is a map of a list item's key fields to their unique values
|
// 'k:<keys>', where <keys> is a map of a list item's key fields to their unique values
|
||||||
// If a key maps to an empty Fields value, the field that key represents is part of the set.
|
// If a key maps to an empty Fields value, the field that key represents is part of the set.
|
||||||
//
|
//
|
||||||
|
@ -95,7 +95,7 @@ func addPortToUsedPorts(ports *[]types.PortMapping, allHostPorts, allContainerPo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getRandomHostPort get a random host port mapping for the given port
|
// getRandomHostPort get a random host port mapping for the given port
|
||||||
// the caller has to supply a array with he already used ports
|
// the caller has to supply an array with the already used ports
|
||||||
func getRandomHostPort(hostPorts *[65536]bool, port types.PortMapping) (types.PortMapping, error) {
|
func getRandomHostPort(hostPorts *[65536]bool, port types.PortMapping) (types.PortMapping, error) {
|
||||||
outer:
|
outer:
|
||||||
for i := 0; i < 15; i++ {
|
for i := 0; i < 15; i++ {
|
||||||
|
@ -284,7 +284,7 @@ func ParseCgroupNamespace(ns string) (Namespace, error) {
|
|||||||
return toReturn, nil
|
return toReturn, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseIPCNamespace parses a ipc namespace specification in string
|
// ParseIPCNamespace parses an ipc namespace specification in string
|
||||||
// form.
|
// form.
|
||||||
func ParseIPCNamespace(ns string) (Namespace, error) {
|
func ParseIPCNamespace(ns string) (Namespace, error) {
|
||||||
toReturn := Namespace{}
|
toReturn := Namespace{}
|
||||||
|
@ -29,7 +29,7 @@ type NamedVolume struct {
|
|||||||
IsAnonymous bool
|
IsAnonymous bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// OverlayVolume holds information about a overlay volume that will be mounted into
|
// OverlayVolume holds information about an overlay volume that will be mounted into
|
||||||
// the container.
|
// the container.
|
||||||
type OverlayVolume struct {
|
type OverlayVolume struct {
|
||||||
// Destination is the absolute path where the mount will be placed in the container.
|
// Destination is the absolute path where the mount will be placed in the container.
|
||||||
@ -139,7 +139,7 @@ func GenVolumeMounts(volumeFlag []string) (map[string]spec.Mount, map[string]*Na
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if overlayFlag {
|
if overlayFlag {
|
||||||
// This is a overlay volume
|
// This is an overlay volume
|
||||||
newOverlayVol := new(OverlayVolume)
|
newOverlayVol := new(OverlayVolume)
|
||||||
newOverlayVol.Destination = dest
|
newOverlayVol.Destination = dest
|
||||||
// convert src to absolute path so we don't end up passing
|
// convert src to absolute path so we don't end up passing
|
||||||
|
@ -461,7 +461,7 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
for _, env := range envs {
|
for _, env := range envs {
|
||||||
// if env arg does not contain a equal sign we have to add the envar to the unit
|
// if env arg does not contain an equal sign we have to add the envar to the unit
|
||||||
// because it does try to red the value from the environment
|
// because it does try to red the value from the environment
|
||||||
if !strings.Contains(env, "=") {
|
if !strings.Contains(env, "=") {
|
||||||
for _, containerEnv := range info.containerEnv {
|
for _, containerEnv := range info.containerEnv {
|
||||||
|
@ -230,7 +230,7 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
||||||
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Up"))
|
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Up"))
|
||||||
|
|
||||||
// Restore a container which name is equal to a image name (#15055)
|
// Restore a container which name is equal to an image name (#15055)
|
||||||
localRunString = getRunString([]string{"--name", "alpine", "quay.io/libpod/alpine:latest", "top"})
|
localRunString = getRunString([]string{"--name", "alpine", "quay.io/libpod/alpine:latest", "top"})
|
||||||
session = podmanTest.Podman(localRunString)
|
session = podmanTest.Podman(localRunString)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
@ -94,7 +94,7 @@ var _ = Describe("Podman UserNS support", func() {
|
|||||||
Expect(session.OutputToString()).To(ContainSubstring("hello"))
|
Expect(session.OutputToString()).To(ContainSubstring("hello"))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman uidmapping and gidmapping with a idmapped volume", func() {
|
It("podman uidmapping and gidmapping with an idmapped volume", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "--uidmap=0:1:500", "--gidmap=0:200:5000", "-v", "my-foo-volume:/foo:Z,idmap", "alpine", "echo", "hello"})
|
session := podmanTest.Podman([]string{"run", "--uidmap=0:1:500", "--gidmap=0:200:5000", "-v", "my-foo-volume:/foo:Z,idmap", "alpine", "echo", "hello"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
if strings.Contains(session.ErrorToString(), "Operation not permitted") {
|
if strings.Contains(session.ErrorToString(), "Operation not permitted") {
|
||||||
|
@ -14,7 +14,7 @@ from test.python.docker.compat import constant
|
|||||||
|
|
||||||
|
|
||||||
def run_top_container(client: DockerClient):
|
def run_top_container(client: DockerClient):
|
||||||
"""Run top command in a alpine container."""
|
"""Run top command in an alpine container."""
|
||||||
ctnr = client.containers.create(
|
ctnr = client.containers.create(
|
||||||
constant.ALPINE,
|
constant.ALPINE,
|
||||||
command="top",
|
command="top",
|
||||||
|
@ -31,7 +31,7 @@ class TestContainers(common.DockerTestCase):
|
|||||||
|
|
||||||
def test_start_container(self):
|
def test_start_container(self):
|
||||||
# Podman docs says it should give a 304 but returns with no response
|
# Podman docs says it should give a 304 but returns with no response
|
||||||
# # Start a already started container should return 304
|
# # Start an already started container should return 304
|
||||||
# response = self.docker.api.start(container=self.top_container_id)
|
# response = self.docker.api.start(container=self.top_container_id)
|
||||||
# self.assertEqual(error.exception.response.status_code, 304)
|
# self.assertEqual(error.exception.response.status_code, 304)
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "info" {
|
@test "info" {
|
||||||
# check network backend, since this is a old version we should use CNI
|
# check network backend, since this is an old version we should use CNI
|
||||||
# when we start testing from 4.0 we should have netavark as backend
|
# when we start testing from 4.0 we should have netavark as backend
|
||||||
run_podman info --format '{{.Host.NetworkBackend}}'
|
run_podman info --format '{{.Host.NetworkBackend}}'
|
||||||
is "$output" "cni" "correct network backend"
|
is "$output" "cni" "correct network backend"
|
||||||
|
Reference in New Issue
Block a user