diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | RELEASE_NOTES.md | 16 | ||||
-rw-r--r-- | changelog.txt | 40 | ||||
-rw-r--r-- | docs/source/markdown/podman-history.1.md | 2 | ||||
-rw-r--r-- | docs/source/markdown/podman-image-trust.1.md | 2 | ||||
-rw-r--r-- | docs/source/markdown/podman-ps.1.md | 2 | ||||
-rw-r--r-- | docs/source/markdown/podman.1.md | 2 | ||||
-rw-r--r-- | pkg/adapter/network.go | 64 | ||||
-rw-r--r-- | pkg/network/network.go | 44 |
9 files changed, 117 insertions, 57 deletions
@@ -3,7 +3,7 @@ export GOPROXY=https://proxy.golang.org GO ?= go DESTDIR ?= -EPOCH_TEST_COMMIT ?= 11541aec80c0fc588f675decd0ce759a4e353684 +EPOCH_TEST_COMMIT ?= 1faa5bb6cdddc2d4b36b1c25261952c9ccf90f61 HEAD ?= HEAD CHANGELOG_BASE ?= HEAD~ CHANGELOG_TARGET ?= HEAD diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c8dac9ee0..7864b9232 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -17,6 +17,9 @@ - Added `tmpcopyup` and `notmpcopyup` options to the `--tmpfs` and `--mount type=tmpfs` flags to `podman create` and `podman run` to control whether the content of directories are copied into tmpfs filesystems mounted over them - Added support for disabling detaching from containers by setting empty detach keys via `--detach-keys=""` - The `podman build` command now supports the `--pull` and `--pull-never` flags to control when images are pulled during a build +- The `podman ps -p` command now shows the name of the pod as well as its ID ([#4703](https://github.com/containers/libpod/issues/4703)) +- The `podman inspect` command on containers will now display the command used to create the container +- The `podman info` command now displays information on registry mirrors ([#4553](https://github.com/containers/libpod/issues/4553)) ### Bugfixes - Fixed a bug where Podman would use an incorrect runtime directory as root, causing state to be deleted after root logged out and making Podman in systemd services not function properly @@ -49,12 +52,21 @@ - Fixed a bug where `podman logs --tail 0` would print all lines of a container's logs, instead of no lines ([#4396](https://github.com/containers/libpod/issues/4396)) - Fixed a bug where the timeout for `slirp4netns` was incorrectly set, resulting in an extremely long timeout ([#4344](https://github.com/containers/libpod/issues/4344)) - Fixed a bug where the `podman stats` command would print CPU utilizations figures incorrectly ([#4409](https://github.com/containers/libpod/issues/4409)) +- Fixed a bug where the `podman inspect --size` command would not print the size of the container's read/write layer if the size was 0 ([#4744](https://github.com/containers/libpod/issues/4744)) +- Fixed a bug where the `podman kill` command was not properly validating signals before use ([#4746](https://github.com/containers/libpod/issues/4746)) +- Fixed a bug where the `--quiet` and `--format` flags to `podman ps` could not be used at the same time +- Fixed a bug where the `podman stop` command was not stopping exec sessions when a container was created without a PID namespace (`--pid=host`) +- Fixed a bug where the `podman pod rm --force` command was not removing anonymous volumes for containers that were removed +- Fixed a bug where the `podman checkpoint` command would not export all changes to the root filesystem of the container if performed more than once on the same container ([#4606](https://github.com/containers/libpod/issues/4606)) +- Fixed a bug where containers started with `--rm` would not be automatically removed on being stopped if an exec session was running inside the container ([#4666](https://github.com/containers/libpod/issues/4666)) ### Misc - The fixes to runtime directory path as root can cause strange behavior if an upgrade is performed while containers are running -- Updated vendored Buildah to v1.11.6 -- Updated vendored containers/storage library to v1.15.3 +- Updated vendored Buildah to v1.12.0 +- Updated vendored containers/storage library to v1.15.4 +- Updated vendored containers/image library to v5.1.0 - Kata Containers runtimes (`kata-runtime`, `kata-qemu`, and `kata-fc`) are now present in the default libpod.conf, but will not be available unless Kata containers is installed on the system +- Podman previously did not allow the creation of containers with a memory limit lower than 4MB. This restriction has been removed, as the `crun` runtime can create containers with significantly less memory ## 1.6.3 ### Features diff --git a/changelog.txt b/changelog.txt index a19c23934..a3e1b474f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,43 @@ +- Changelog for v1.7.0-rc2 (2020-01-02) + * Update release notes with further changes from 1.7.0 + * refactor network commands + * Fix race condition in kill test leading to hang + * Ensure 'make uninstall' remove bin and conf files. + * Add the pod name when we use `podman ps -p` + * Ensure SizeRw is shown when a user does 'inspect --size -t container'. + * signal parsing - better input validation + * The --quiet flag does not conflict with templates in ps + * add struct response for removal of images + * Update containers/storage to v1.15.4 + * Update containers/storage to v1.15.4 + * zsh completion: ignore multi-line output in Flags + * build(deps): bump github.com/containers/image/v5 from 5.0.0 to 5.1.0 + * if container is not in a pid namespace, stop all processes + * update c/buildah to v1.12.0 + * Remove volumes after containers in pod remove + * libpod: drop arbitrary memory limit of 4M + * docs: add workaround for --device with rootless containers + * install.md: openSUSE dependencies + * Use systemd/sd-daemon.h headers for systemd presence + * Allow the injection of TESTFLAGS + * Remove coverprofile from the repository + * troubleshooting.md: rebased master and bumped 18 to 19 + * Fix F30-F31 migration for Podman 1.7.0 + * runtime.go: show registries data and search table + * container config: add CreateCommand + * Fixed the path of hack scripts in spec file + * runtime.go: show search table in podman info + * podman info man: example update + * podman: mirror information + * Reap exec sessions on cleanup and removal + * [Makefile] `LDFLAGS` is reserved for the GCC linker + * podman images history test - clean up + * Bump gitvalidation epoch + * Bump to v1.7.0-dev + * allow exec to read files of environment variables + * Correctly export the root file-system changes + * build(deps): bump github.com/uber/jaeger-client-go + - Changelog for v1.7.0-rc1 (2019-12-11) * Update release notes for 1.7.0 * docs: update podman-{pod-,}top man pages diff --git a/docs/source/markdown/podman-history.1.md b/docs/source/markdown/podman-history.1.md index a67cb0286..078864faa 100644 --- a/docs/source/markdown/podman-history.1.md +++ b/docs/source/markdown/podman-history.1.md @@ -22,7 +22,7 @@ Valid placeholders for the Go template are listed below: | **Placeholder** | **Description** | | --------------- | ----------------------------------------------------------------------------- | | .ID | Image ID | -| .Created | if **--human**, time elapsed since creation, otherwise time stamp of creation | +| .Created | if --human, time elapsed since creation, otherwise time stamp of creation | | .CreatedBy | Command used to create the layer | | .Size | Size of layer on disk | | .Comment | Comment for the layer | diff --git a/docs/source/markdown/podman-image-trust.1.md b/docs/source/markdown/podman-image-trust.1.md index 3fe4f7f52..435d117f1 100644 --- a/docs/source/markdown/podman-image-trust.1.md +++ b/docs/source/markdown/podman-image-trust.1.md @@ -86,7 +86,7 @@ Display trust as JSON ## SEE ALSO -policy-json(5) +containers-policy.json(5) ## HISTORY January 2019, updated by Tom Sweeney (tsweeney at redhat dot com) diff --git a/docs/source/markdown/podman-ps.1.md b/docs/source/markdown/podman-ps.1.md index 298de0b2b..024b85ea5 100644 --- a/docs/source/markdown/podman-ps.1.md +++ b/docs/source/markdown/podman-ps.1.md @@ -105,7 +105,7 @@ Valid filters are listed below: | name | [Name] Container's name | | label | [Key] or [Key=Value] Label assigned to a container | | exited | [Int] Container's exit code | -| status | [Status] Container's status: *created*, *exited*, *paused*, *running*, *unknown* | +| status | [Status] Container's status: 'created', 'exited', 'paused', 'running', 'unknown' | | ancestor | [ImageName] Image or descendant used to create container | | before | [ID] or [Name] Containers created before this container | | since | [ID] or [Name] Containers created since this container | diff --git a/docs/source/markdown/podman.1.md b/docs/source/markdown/podman.1.md index c62f54fbb..01c750144 100644 --- a/docs/source/markdown/podman.1.md +++ b/docs/source/markdown/podman.1.md @@ -271,7 +271,7 @@ The Network File System (NFS) and other distributed file systems (for example: L For more information, please refer to the [Podman Troubleshooting Page](https://github.com/containers/libpod/blob/master/troubleshooting.md). ## SEE ALSO -`containers-mounts.conf(5)`, `containers-registries.conf(5)`, `containers-storage.conf(5)`, `buildah(1)`, `libpod.conf(5)`, `oci-hooks(5)`, `policy.json(5)`, `subuid(5)`, `subgid(5)`, `slirp4netns(1)` +`containers-mounts.conf(5)`, `containers-registries.conf(5)`, `containers-storage.conf(5)`, `buildah(1)`, `libpod.conf(5)`, `oci-hooks(5)`, `containers-policy.json(5)`, `subuid(5)`, `subgid(5)`, `slirp4netns(1)` ## HISTORY Dec 2016, Originally compiled by Dan Walsh <dwalsh@redhat.com> diff --git a/pkg/adapter/network.go b/pkg/adapter/network.go index 160e334e9..b25f54a13 100644 --- a/pkg/adapter/network.go +++ b/pkg/adapter/network.go @@ -67,14 +67,10 @@ func (r *LocalRuntime) NetworkInspect(cli *cliconfig.NetworkInspectValues) error rawCNINetworks []map[string]interface{} ) for _, name := range cli.InputArgs { - b, err := network.ReadRawCNIConfByName(name) + rawList, err := network.InspectNetwork(name) if err != nil { return err } - rawList := make(map[string]interface{}) - if err := json.Unmarshal(b, &rawList); err != nil { - return fmt.Errorf("error parsing configuration list: %s", err) - } rawCNINetworks = append(rawCNINetworks, rawList) } out, err := json.MarshalIndent(rawCNINetworks, "", "\t") @@ -98,7 +94,20 @@ func (r *LocalRuntime) NetworkRemove(ctx context.Context, cli *cliconfig.Network if err != nil { return networkRmSuccesses, networkRmErrors, err } - if err := r.removeNetwork(ctx, name, containers, cli.Force); err != nil { + // We need to iterate containers looking to see if they belong to the given network + for _, c := range containers { + if util.StringInSlice(name, c.Config().Networks) { + // if user passes force, we nuke containers + if !cli.Force { + // Without the force option, we return an error + return nil, nil, errors.Errorf("%q has associated containers with it. Use -f to forcibly delete containers", name) + } + if err := r.RemoveContainer(ctx, c.Container, true, true); err != nil { + return nil, nil, err + } + } + } + if err := network.RemoveNetwork(name); err != nil { if lastError != nil { networkRmErrors[name] = lastError } @@ -110,49 +119,6 @@ func (r *LocalRuntime) NetworkRemove(ctx context.Context, cli *cliconfig.Network return networkRmSuccesses, networkRmErrors, lastError } -// removeNetwork removes a single network and its containers given a force bool -func (r *LocalRuntime) removeNetwork(ctx context.Context, name string, containers []*Container, force bool) error { - cniPath, err := network.GetCNIConfigPathByName(name) - if err != nil { - return err - } - // We need to iterate containers looking to see if they belong to the given network - for _, c := range containers { - if util.StringInSlice(name, c.Config().Networks) { - // if user passes force, we nuke containers - if force { - if err := r.RemoveContainer(ctx, c.Container, true, true); err != nil { - return err - } - } else { - // Without the the force option, we return an error - return errors.Errorf("%q has associated containers with it. use -f to forcibly delete containers", name) - } - - } - } - // Before we delete the configuration file, we need to make sure we can read and parse - // it to get the network interface name so we can remove that too - interfaceName, err := network.GetInterfaceNameFromConfig(cniPath) - if err != nil { - return errors.Wrapf(err, "failed to find network interface name in %q", cniPath) - } - liveNetworkNames, err := network.GetLiveNetworkNames() - if err != nil { - return errors.Wrapf(err, "failed to get live network names") - } - if util.StringInSlice(interfaceName, liveNetworkNames) { - if err := network.RemoveInterface(interfaceName); err != nil { - return errors.Wrapf(err, "failed to delete the network interface %q", interfaceName) - } - } - // Remove the configuration file - if err := os.Remove(cniPath); err != nil { - return errors.Wrapf(err, "failed to remove network configuration file %q", cniPath) - } - return nil -} - // NetworkCreateBridge creates a CNI network func (r *LocalRuntime) NetworkCreateBridge(cli *cliconfig.NetworkCreateValues) (string, error) { isGateway := true diff --git a/pkg/network/network.go b/pkg/network/network.go index b241a66c0..bb6f13579 100644 --- a/pkg/network/network.go +++ b/pkg/network/network.go @@ -1,11 +1,13 @@ package network import ( - "github.com/containers/libpod/pkg/util" + "encoding/json" "net" + "os" "github.com/containernetworking/cni/pkg/types" "github.com/containernetworking/plugins/plugins/ipam/host-local/backend/allocator" + "github.com/containers/libpod/pkg/util" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -148,3 +150,43 @@ func ValidateUserNetworkIsAvailable(userNet *net.IPNet) error { } return nil } + +// RemoveNetwork removes a given network by name. If the network has container associated with it, that +// must be handled outside the context of this. +func RemoveNetwork(name string) error { + cniPath, err := GetCNIConfigPathByName(name) + if err != nil { + return err + } + // Before we delete the configuration file, we need to make sure we can read and parse + // it to get the network interface name so we can remove that too + interfaceName, err := GetInterfaceNameFromConfig(cniPath) + if err != nil { + return errors.Wrapf(err, "failed to find network interface name in %q", cniPath) + } + liveNetworkNames, err := GetLiveNetworkNames() + if err != nil { + return errors.Wrapf(err, "failed to get live network names") + } + if util.StringInSlice(interfaceName, liveNetworkNames) { + if err := RemoveInterface(interfaceName); err != nil { + return errors.Wrapf(err, "failed to delete the network interface %q", interfaceName) + } + } + // Remove the configuration file + if err := os.Remove(cniPath); err != nil { + return errors.Wrapf(err, "failed to remove network configuration file %q", cniPath) + } + return nil +} + +// InspectNetwork reads a CNI config and returns its configuration +func InspectNetwork(name string) (map[string]interface{}, error) { + b, err := ReadRawCNIConfByName(name) + if err != nil { + return nil, err + } + rawList := make(map[string]interface{}) + err = json.Unmarshal(b, &rawList) + return rawList, err +} |