Skip to content

Commit

Permalink
Merge pull request #10461 from mheon/rc3_backports
Browse files Browse the repository at this point in the history
Backports for v3.2.0-RC3
  • Loading branch information
openshift-merge-robot authored May 26, 2021
2 parents b909bca + f490230 commit a5a2416
Show file tree
Hide file tree
Showing 34 changed files with 523 additions and 109 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ bin/podman.cross.%: .gopathok
.PHONY: local-cross
local-cross: $(CROSS_BUILD_TARGETS) ## Cross compile podman binary for multiple architectures

.PHONY: cross
cross: local-cross

# Update nix/nixpkgs.json its latest stable commit
.PHONY: nixpkgs
nixpkgs:
Expand Down
6 changes: 4 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
- The `podman play kube` now treats environment variables configured as references to a `ConfigMap` as mandatory unless the `optional` parameter was set; this better matches the behavior of Kubernetes.
- Podman now supports the `--context=default` flag from Docker as a no-op for compatibility purposes.
- When Podman is run as root, but without `CAP_SYS_ADMIN` being available, it will run in a user namespace using the same code as rootless Podman (instead of failing outright).
- The `podman info` command now includes the path of the Seccomp profile Podman is using, and whether Podman is connected to a remote service or running containers locally.
- The `podman info` command now includes the path of the Seccomp profile Podman is using, available cgroup controllers, and whether Podman is connected to a remote service or running containers locally.
- Containers created with the `--rm` option now automatically use the `volatile` storage flag when available for their root filesystems, causing them not to write changes to disk as often as they will be removed at completion anyways. This should result in improved performance.
- The `podman generate systemd --new` command will now include environment variables referenced by the container in generated unit files if the value would be looked up from the system environment.
- Podman now requires that Conmon v2.0.24 be available.

### Bugfixes
- Fixed a bug where the remote Podman client's `podman build` command did not support the `--arch`, `--platform`, and `--os`, options.
- Fixed a bug where the remote Podman client's `podman build` command ignored the `--rm=false` option ([#9869](https://github.com/containers/podman/issues/9869)).
- Fixed a bug where the remote Podman client's `podman build --iidfile` command could include extra output (in addition to just the image ID) in the image ID file written ([#10233](https://github.com/containers/podman/issues/10233)).
- Fixed a bug where the remote Podman client's `podman build` command did not preserve hardlinks when moving files into the container via `COPY` instructions ([#9893](https://github.com/containers/podman/issues/9893)).
- Fixed a bug where the `podman generate systemd --new` command could generate extra `--iidfile` arguments if the container was already created with one.
- Fixed a bug where the `podman generate kube` command produced incorrect YAML for containers which bind-mounted both `/` and `/root` from the host system into the container ([#9764](https://github.com/containers/podman/issues/9764)).
- Fixed a bug where pods created by `podman play kube` from YAML that specified `ShareProcessNamespace` would only share the PID namespace (and not also the UTS, Network, and IPC namespaces) ([#9128](https://github.com/containers/podman/issues/9128)).
Expand All @@ -53,9 +55,9 @@
- Fixed a bug where setting a custom Seccomp profile via the `seccomp_profile` option in `containers.conf` had no effect, and the default profile was used instead.
- Fixed a bug where the `--cgroup-parent` option to `podman create` and `podman run` was ignored in rootless Podman on cgroups v2 systems with the `cgroupfs` cgroup manager ([#10173](https://github.com/containers/podman/issues/10173)).
- Fixed a bug where the `IMAGE` and `NAME` variables in `podman container runlabel` were not being correctly substituted ([#10192](https://github.com/containers/podman/issues/10192)).
- Fixed a bug where the remote Podman client's `podman build --iidfile` command could include extra output (in addition to just the image ID) in the image ID file written ([#10233](https://github.com/containers/podman/issues/10233)).
- Fixed a bug where Podman could freeze when creating containers with a specific combination of volumes and working directory ([#10216](https://github.com/containers/podman/issues/10216)).
- Fixed a bug where rootless Podman containers restarted by restart policy (e.g. containers created with `--restart=always`) would lose networking after being restarted ([#8047](https://github.com/containers/podman/issues/8047)).
- Fixed a bug where the `podman cp` command could not copy files into containers created with the `--pid=host` flag ([#9985](https://github.com/containers/podman/issues/9985)).

### API
- Fixed a bug where the Compat Create endpoint for Containers did not allow advanced network options to be set ([#10110](https://github.com/containers/podman/issues/10110)).
Expand Down
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-build.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ given.
#### **--cert-dir**=*path*

Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (This option is not available with the remote Podman client)
Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client)

#### **--cgroup-parent**=*path*

Expand Down Expand Up @@ -972,7 +972,7 @@ If you are using `useradd` within your build script, you should pass the
useradd to stop creating the lastlog file.

## SEE ALSO
podman(1), buildah(1), containers-registries.conf(5), crun(8), runc(8), useradd(8), podman-ps(1), podman-rm(1)
podman(1), buildah(1), containers-certs.d(5), containers-registries.conf(5), crun(8), runc(8), useradd(8), podman-ps(1), podman-rm(1)

## HISTORY
Aug 2020, Additional options and .dockerignore added by Dan Walsh `<[email protected]>`
Expand Down
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-container-runlabel.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The runlabel command will not execute if --display is specified.
#### **--cert-dir**=*path*

Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (This option is not available with the remote Podman client)
Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client)

#### **--creds**=*[username[:password]]*

Expand Down Expand Up @@ -105,7 +105,7 @@ $ sudo podman container runlabel --display run foobar
```

## SEE ALSO
podman(1)
podman(1), containers-certs.d(5)

## HISTORY
September 2018, Originally compiled by Brent Baude (bbaude at redhat dot com)
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-generate-systemd.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ podman\-generate\-systemd - Generate systemd unit file(s) for a container or pod
**podman generate systemd** will create a systemd unit file that can be used to control a container or pod.
By default, the command will print the content of the unit files to stdout.

_Note: If you use this command with the remote client, you would still have to place the generated units on the remote system._
_Note: If you use this command with the remote client, you would still have to place the generated units on the remote system. Moreover, please make sure that the XDG_RUNTIME_DIR environment variable is set. If unset, you may set it via `export XDG_RUNTIME_DIR=/run/user/$(id -u)`._

## OPTIONS

Expand Down
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-image-sign.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Sign all the manifests of the multi-architecture image (default false).
#### **--cert-dir**=*path*

Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (This option is not available with the remote Podman client)
Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client)

#### **--directory**, **-d**=*dir*

Expand Down Expand Up @@ -61,7 +61,7 @@ the signature will be written into sub-directories of
the signature will be 'read' from that same location on a pull-related function.

## SEE ALSO
containers-registries.d(5)
containers-certs.d(5), containers-registries.d(5)

## HISTORY
November 2018, Originally compiled by Qi Wang (qiwan at redhat dot com)
13 changes: 13 additions & 0 deletions docs/source/markdown/podman-info.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ $ podman info
host:
arch: amd64
buildahVersion: 1.19.0-dev
cgroupControllers:
- cpuset
- cpu
- io
- memory
- pids
cgroupManager: systemd
cgroupVersion: v2
conmon:
Expand Down Expand Up @@ -145,6 +151,13 @@ Run podman info with JSON formatted response:
"buildahVersion": "1.19.0-dev",
"cgroupManager": "systemd",
"cgroupVersion": "v2",
"cgroupControllers": [
"cpuset",
"cpu",
"io",
"memory",
"pids"
],
"conmon": {
"package": "conmon-2.0.22-2.fc33.x86_64",
"path": "/usr/bin/conmon",
Expand Down
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-login.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Return the logged-in user for the registry. Return error if no login is found.
#### **--cert-dir**=*path*

Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (This option is not available with the remote Podman client)
Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client)

#### **--tls-verify**=*true|false*

Expand Down Expand Up @@ -108,7 +108,7 @@ Login Succeeded!
```

## SEE ALSO
podman(1), podman-logout(1), containers-auth.json(5), containers-registries.conf(5)
podman(1), podman-logout(1), containers-auth.json(5), containers-certs.d(5), containers-registries.conf(5)

## HISTORY
August 2017, Originally compiled by Urvashi Mohnani <[email protected]>
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-manifest-add.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ environment variable. `export REGISTRY_AUTH_FILE=path`
#### **--cert-dir**=*path*

Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (This option is not available with the remote Podman client)
Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client)

#### **--creds**=*creds*

Expand Down Expand Up @@ -110,4 +110,4 @@ podman manifest add --arch arm64 --variant v8 mylist:v1.11 docker://71c201d10fff
```

## SEE ALSO
podman(1), podman-manifest(1), podman-manifest-create(1), podman-manifest-inspect(1), podman-manifest-push(1), podman-manifest-remove(1), podman-rmi(1)
podman(1), podman-manifest(1), podman-manifest-create(1), podman-manifest-inspect(1), podman-manifest-push(1), podman-manifest-remove(1), podman-rmi(1), containers-certs.d(5)
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-manifest-push.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ environment variable. `export REGISTRY_AUTH_FILE=path`
#### **--cert-dir**=*path*

Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (This option is not available with the remote Podman client)
Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client)

#### **--creds**=*creds*

Expand Down Expand Up @@ -107,4 +107,4 @@ podman manifest push mylist:v1.11 docker://registry.example.org/mylist:v1.11
```

## SEE ALSO
podman(1), podman-manifest(1), podman-manifest-add(1), podman-manifest-create(1), podman-manifest-inspect(1), podman-manifest-remove(1), podman-rmi(1)
podman(1), podman-manifest(1), podman-manifest-add(1), podman-manifest-create(1), podman-manifest-inspect(1), podman-manifest-remove(1), podman-rmi(1), containers-certs.d(5)
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-play-kube.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ environment variable. `export REGISTRY_AUTH_FILE=path`
#### **--cert-dir**=*path*

Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (This option is not available with the remote Podman client)
Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client)

#### **--configmap**=*path*

Expand Down Expand Up @@ -132,7 +132,7 @@ $ podman play kube demo.yml --network cni1,cni2
Please take into account that CNI networks must be created first using podman-network-create(1).

## SEE ALSO
podman(1), podman-container(1), podman-pod(1), podman-generate-kube(1), podman-play(1), podman-network-create(1)
podman(1), podman-container(1), podman-pod(1), podman-generate-kube(1), podman-play(1), podman-network-create(1), containers-certs.d(5)

## HISTORY
December 2018, Originally compiled by Brent Baude (bbaude at redhat dot com)
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-pull.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ environment variable. `export REGISTRY_AUTH_FILE=path`
#### **--cert-dir**=*path*

Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (This option is not available with the remote Podman client)
Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client)

#### **--creds**=*[username[:password]]*

Expand Down Expand Up @@ -217,7 +217,7 @@ registries.conf is the configuration file which specifies which container regist
NOTE: Use the environment variable `TMPDIR` to change the temporary storage location of downloaded container images. Podman defaults to use `/var/tmp`.

## SEE ALSO
podman(1), podman-push(1), podman-login(1), containers-registries.conf(5)
podman(1), podman-push(1), podman-login(1), containers-certs.d(5), containers-registries.conf(5)

## HISTORY
July 2017, Originally compiled by Urvashi Mohnani <[email protected]>
4 changes: 2 additions & 2 deletions docs/source/markdown/podman-push.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ value can be entered. The password is entered without echo.
#### **--cert-dir**=*path*

Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (This option is not available with the remote Podman client)
Please refer to containers-certs.d(5) for details. (This option is not available with the remote Podman client)

#### **--compress**

Expand Down Expand Up @@ -161,4 +161,4 @@ Storing signatures
```

## SEE ALSO
podman(1), podman-pull(1), podman-login(1)
podman(1), podman-pull(1), podman-login(1), containers-certs.d(5)
25 changes: 18 additions & 7 deletions libpod/container_copy_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,32 @@ func (c *Container) joinMountAndExec(ctx context.Context, f func() error) error
}
defer mountFD.Close()

pidFD, err := getFD(PIDNS)
inHostPidNS, err := c.inHostPidNS()
if err != nil {
errChan <- err
errChan <- errors.Wrap(err, "checking inHostPidNS")
return
}
defer pidFD.Close()
if err := unix.Unshare(unix.CLONE_NEWNS); err != nil {
errChan <- err
return
var pidFD *os.File
if !inHostPidNS {
pidFD, err = getFD(PIDNS)
if err != nil {
errChan <- err
return
}
defer pidFD.Close()
}
if err := unix.Setns(int(pidFD.Fd()), unix.CLONE_NEWPID); err != nil {

if err := unix.Unshare(unix.CLONE_NEWNS); err != nil {
errChan <- err
return
}

if pidFD != nil {
if err := unix.Setns(int(pidFD.Fd()), unix.CLONE_NEWPID); err != nil {
errChan <- err
return
}
}
if err := unix.Setns(int(mountFD.Fd()), unix.CLONE_NEWNS); err != nil {
errChan <- err
return
Expand Down
23 changes: 23 additions & 0 deletions libpod/container_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -890,3 +890,26 @@ func (c *Container) generateInspectContainerHostConfig(ctrSpec *spec.Spec, named

return hostConfig, nil
}

// Return true if the container is running in the host's PID NS.
func (c *Container) inHostPidNS() (bool, error) {
if c.config.PIDNsCtr != "" {
return false, nil
}
ctrSpec, err := c.specFromState()
if err != nil {
return false, err
}
if ctrSpec.Linux != nil {
// Locate the spec's PID namespace.
// If there is none, it's pid=host.
// If there is one and it has a path, it's "ns:".
// If there is no path, it's default - the empty string.
for _, ns := range ctrSpec.Linux.Namespaces {
if ns.Type == spec.PIDNamespace {
return false, nil
}
}
}
return true, nil
}
2 changes: 1 addition & 1 deletion libpod/define/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var (

// ErrOCIRuntimeNotFound indicates the OCI runtime attempted to invoke a command
// that was not found
ErrOCIRuntimeNotFound = errors.New("OCI not found")
ErrOCIRuntimeNotFound = errors.New("OCI runtime attempted to invoke a command that was not found")

// ErrOCIRuntimeUnavailable indicates that the OCI runtime associated to a container
// could not be found in the configuration
Expand Down
31 changes: 16 additions & 15 deletions libpod/define/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ type SecurityInfo struct {

// HostInfo describes the libpod host
type HostInfo struct {
Arch string `json:"arch"`
BuildahVersion string `json:"buildahVersion"`
CgroupManager string `json:"cgroupManager"`
CGroupsVersion string `json:"cgroupVersion"`
Conmon *ConmonInfo `json:"conmon"`
CPUs int `json:"cpus"`
Distribution DistributionInfo `json:"distribution"`
EventLogger string `json:"eventLogger"`
Hostname string `json:"hostname"`
IDMappings IDMappings `json:"idMappings,omitempty"`
Kernel string `json:"kernel"`
MemFree int64 `json:"memFree"`
MemTotal int64 `json:"memTotal"`
OCIRuntime *OCIRuntimeInfo `json:"ociRuntime"`
OS string `json:"os"`
Arch string `json:"arch"`
BuildahVersion string `json:"buildahVersion"`
CgroupManager string `json:"cgroupManager"`
CGroupsVersion string `json:"cgroupVersion"`
CgroupControllers []string `json:"cgroupControllers"`
Conmon *ConmonInfo `json:"conmon"`
CPUs int `json:"cpus"`
Distribution DistributionInfo `json:"distribution"`
EventLogger string `json:"eventLogger"`
Hostname string `json:"hostname"`
IDMappings IDMappings `json:"idMappings,omitempty"`
Kernel string `json:"kernel"`
MemFree int64 `json:"memFree"`
MemTotal int64 `json:"memTotal"`
OCIRuntime *OCIRuntimeInfo `json:"ociRuntime"`
OS string `json:"os"`
// RemoteSocket returns the UNIX domain socket the Podman service is listening on
RemoteSocket *RemoteSocket `json:"remoteSocket,omitempty"`
RuntimeInfo map[string]interface{} `json:"runtimeInfo,omitempty"`
Expand Down
Loading

0 comments on commit a5a2416

Please sign in to comment.