Skip to content

Commit ddd8a17

Browse files
Merge pull request #9327 from mheon/30_final
Bump to v3.0 Final
2 parents 2b89fe7 + e05e53c commit ddd8a17

File tree

14 files changed

+255
-53
lines changed

14 files changed

+255
-53
lines changed

RELEASE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@
112112
- Fixed a bug where failures during the resizing of a container's TTY would print the wrong error.
113113
- Fixed a bug where the `podman network disconnect` command could cause the `podman inspect` command to fail for a container until it was restarted ([#9234](https://github.com/containers/podman/issues/9234)).
114114
- Fixed a bug where containers created from a read-only rootfs (using the `--rootfs` option to `podman create` and `podman run`) would fail ([#9230](https://github.com/containers/podman/issues/9230)).
115+
- Fixed a bug where specifying Go templates to the `--format` option to multiple Podman commands did not support the `join` function ([#8773](https://github.com/containers/podman/issues/8773)).
116+
- Fixed a bug where the `podman rmi` command could, when run in parallel on multiple images, return `layer not known` errors ([#6510](https://github.com/containers/podman/issues/6510)).
117+
- Fixed a bug where the `podman inspect` command on containers displayed unlimited ulimits incorrectly ([#9303](https://github.com/containers/podman/issues/9303)).
118+
- Fixed a bug where Podman would fail to start when a volume was mounted over a directory in a container that contained symlinks that terminated outside the directory and its subdirectories ([#6003](https://github.com/containers/podman/issues/6003)).
115119

116120
### API
117121
- Libpod API version has been bumped to v3.0.0.
@@ -134,10 +138,12 @@
134138
- Fixed a bug where the Compat Load API for Images did not properly clean up temporary files.
135139
- Fixed a bug where the Compat Create API for Networks could panic when an empty IPAM configuration was specified.
136140
- Fixed a bug where the Compat Inspect and List APIs for Networks did not include Scope.
141+
- Fixed a bug where the Compat Wait endpoint for Containers did not support the same wait conditions that Docker did.
137142

138143
### Misc
139144
- Updated Buildah to v1.19.2
140145
- Updated the containers/storage library to v1.24.5
146+
- Updated the containers/image library to v5.10.2
141147
- Updated the containers/common library to v0.33.4
142148

143149
## v2.2.1

changelog.txt

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,95 @@
1+
- Changelog for v3.0.0 (2021-02-11):
2+
* Update release notes for v3.0 final
3+
* Rewrite copy-up to use buildah Copier
4+
* Display correct value for unlimited ulimit
5+
* make `podman rmi` more robust
6+
* Allow path completion for podman create/run --rootfs
7+
* vendor github.com/containers/image v5.10.2
8+
* Add default template functions
9+
* Fix per review request
10+
* Increase timeouts in some tests
11+
* Add test for Docker APIv2 wait
12+
* Implement Docker wait conditions
13+
* Improve ContainerEngine.ContainerWait()
14+
* Improve container libpod.Wait*() functions
15+
* [NO TESTS NEEDED] style: indendation
16+
* [NO TESTS NEEDED] fixup: remove debug code
17+
* [NO TESTS NEEDED] Generated files
18+
* Cleanup bindings for image pull
19+
* [NO TESTS NEEDED] Improve generator
20+
* Fix invalid wait condition on kill
21+
* Switch podman image push handlers to use abi
22+
* podman-remote ps --external --pod --sort do not work.
23+
* Fix --arch and --os flags to work correctly
24+
* Switch podman stop/kill/wait handlers to use abi
25+
* Fix handling of container remove
26+
* Bump to v3.0.0-dev
27+
* Bump to v3.0.0-RC3
28+
* Further release notes for v3.0
29+
* Bump remote API version to 3.0.0
30+
* fix logic when not creating a workdir
31+
* play kube selinux test case
32+
* play kube selinux test case
33+
* play kube selinux label test case
34+
* play kube selinux label issue
35+
* Fix podman network disconnect wrong NetworkStatus number
36+
* Bump to v0.33.4
37+
* Bump github.com/containernetworking/cni from 0.8.0 to 0.8.1
38+
* Update release notes for v3.0.0-RC3
39+
* generate kube: handle entrypoint
40+
* Allow pods to use --net=none
41+
* Report StatusConflict on Pod opt partial failures
42+
* bindings: attach: warn correct error
43+
* Make slirp MTU configurable (network_cmd_options)
44+
* Fix podman generate systemd --new special char handling
45+
* Fix --network parsing for podman pod create
46+
* Endpoint that lists containers does not return correct Status value
47+
* Docker ignores mount flags that begin with constency
48+
* podman generate kube ignores --network=host
49+
* Honor custom DNS in play|generate kube
50+
* Don't fail if one of the cgroups is not setup
51+
* Fix #9100 Change console mode message to debug
52+
* Update release notes from master
53+
* libpod: move slirp magic IPs to consts
54+
* rootlessport: set source IP to slirp4netns device
55+
* Bump rootless-containers/rootlesskit to v0.12.0
56+
* Gating tests: diff test: workaround for RHEL8 failure
57+
* Bump to containers/common v0.33.3
58+
* add macvlan as a supported network driver
59+
* podman build --pull: refine help message and docs
60+
* Cirrus: Build static podman-remote
61+
* Fix static build cache by using cachix
62+
* Cirrus: Fix running Validate task on branches
63+
* Bump to v3.0.0-dev
64+
* Bump to v3.0.0-RC2
65+
* Cirrus: add bindings checks
66+
* make bindings generation explicit
67+
* make bindings generation more robuts
68+
* simplify bindings generation
69+
* make: generate bindings: use vendor
70+
* Make generate systemd --new robust against double curly braces
71+
* Ensure shutdown handler access is syncronized
72+
* workdir presence checks
73+
* libpod: add (*Container).ResolvePath()
74+
* Add default net info in container inspect
75+
* Fix podman history --no-trunc for the CREATED BY field
76+
* Ensure the Volumes field in Compat Create is honored
77+
* remote exec: write conmon error on hijacked connection
78+
* Add support for rootless network-aliases
79+
* Allow static ip and mac with rootless cni network
80+
* [CI:DOCS]Correct static API html path
81+
* disable dnsname when --internal
82+
* Use random network names in the e2e tests
83+
* [v3.0] fix RHEL gating test: the /sys thing
84+
* Bump golang.org/x/crypto v3.0
85+
* Set log driver for compatability containers
86+
* [CI:DOCS] Cirrus: Skip smoke task on branch-push
87+
* [CI:DOCS]Do not run compose tests with CI:DOCS
88+
* Add binding options for container|pod exists
89+
* runner.sh : deal with bash 'set -e'
90+
* [CI:DOCS]Add readthedoc link for 3.0 docs
91+
* [CI:DOCS]Add static HTML for api docs for v3.0
92+
193
- Changelog for v3.0.0-rc1 (2021-01-17):
294
* Create release notes for V3.0.0
395
* Rename AutocompletePortCommand func

cmd/podman/common/completion.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,12 @@ func AutocompleteCreateRun(cmd *cobra.Command, args []string, toComplete string)
426426
return nil, cobra.ShellCompDirectiveNoFileComp
427427
}
428428
if len(args) < 1 {
429+
// check if the rootfs flag is set
430+
// if it is set to true provide directory completion
431+
rootfs, err := cmd.Flags().GetBool("rootfs")
432+
if err == nil && rootfs {
433+
return nil, cobra.ShellCompDirectiveFilterDirs
434+
}
429435
return getImages(cmd, toComplete)
430436
}
431437
// TODO: add path completion for files in the image

contrib/spec/podman.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Epoch: 99
4242
%else
4343
Epoch: 0
4444
%endif
45-
Version: 3.0.0
45+
Version: 3.0.1
4646
Release: #COMMITDATE#.git%{shortcommit0}%{?dist}
4747
Summary: Manage Pods, Containers and Container Images
4848
License: ASL 2.0

libpod/container_inspect.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,8 +864,8 @@ func (c *Container) generateInspectContainerHostConfig(ctrSpec *spec.Spec, named
864864
for _, limit := range ctrSpec.Process.Rlimits {
865865
newLimit := define.InspectUlimit{}
866866
newLimit.Name = limit.Type
867-
newLimit.Soft = limit.Soft
868-
newLimit.Hard = limit.Hard
867+
newLimit.Soft = int64(limit.Soft)
868+
newLimit.Hard = int64(limit.Hard)
869869
hostConfig.Ulimits = append(hostConfig.Ulimits, newLimit)
870870
}
871871
}

libpod/container_internal.go

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"strings"
1414
"time"
1515

16+
"github.com/containers/buildah/copier"
1617
"github.com/containers/podman/v2/libpod/define"
1718
"github.com/containers/podman/v2/libpod/events"
1819
"github.com/containers/podman/v2/pkg/cgroups"
@@ -1580,18 +1581,8 @@ func (c *Container) mountNamedVolume(v *ContainerNamedVolume, mountpoint string)
15801581
return nil, err
15811582
}
15821583

1583-
// HACK HACK HACK - copy up into a volume driver is 100% broken
1584-
// right now.
1585-
if vol.UsesVolumeDriver() {
1586-
logrus.Infof("Not copying up into volume %s as it uses a volume driver", vol.Name())
1587-
return vol, nil
1588-
}
1589-
15901584
// If the volume is not empty, we should not copy up.
1591-
volMount, err := vol.MountPoint()
1592-
if err != nil {
1593-
return nil, err
1594-
}
1585+
volMount := vol.mountPoint()
15951586
contents, err := ioutil.ReadDir(volMount)
15961587
if err != nil {
15971588
return nil, errors.Wrapf(err, "error listing contents of volume %s mountpoint when copying up from container %s", vol.Name(), c.ID())
@@ -1607,8 +1598,55 @@ func (c *Container) mountNamedVolume(v *ContainerNamedVolume, mountpoint string)
16071598
if err != nil {
16081599
return nil, errors.Wrapf(err, "error calculating destination path to copy up container %s volume %s", c.ID(), vol.Name())
16091600
}
1610-
if err := c.copyWithTarFromImage(srcDir, volMount); err != nil && !os.IsNotExist(err) {
1611-
return nil, errors.Wrapf(err, "error copying content from container %s into volume %s", c.ID(), vol.Name())
1601+
// Do a manual stat on the source directory to verify existence.
1602+
// Skip the rest if it exists.
1603+
// TODO: Should this be stat or lstat? I'm using lstat because I
1604+
// think copy-up doesn't happen when the source is a link.
1605+
srcStat, err := os.Lstat(srcDir)
1606+
if err != nil {
1607+
if os.IsNotExist(err) {
1608+
// Source does not exist, don't bother copying
1609+
// up.
1610+
return vol, nil
1611+
}
1612+
return nil, errors.Wrapf(err, "error identifying source directory for copy up into volume %s", vol.Name())
1613+
}
1614+
// If it's not a directory we're mounting over it.
1615+
if !srcStat.IsDir() {
1616+
return vol, nil
1617+
}
1618+
1619+
// Buildah Copier accepts a reader, so we'll need a pipe.
1620+
reader, writer := io.Pipe()
1621+
defer reader.Close()
1622+
1623+
errChan := make(chan error, 1)
1624+
1625+
logrus.Infof("About to copy up into volume %s", vol.Name())
1626+
1627+
// Copy, container side: get a tar archive of what needs to be
1628+
// streamed into the volume.
1629+
go func() {
1630+
defer writer.Close()
1631+
getOptions := copier.GetOptions{
1632+
KeepDirectoryNames: false,
1633+
}
1634+
errChan <- copier.Get(mountpoint, "", getOptions, []string{v.Dest + "/."}, writer)
1635+
}()
1636+
1637+
// Copy, volume side: stream what we've written to the pipe, into
1638+
// the volume.
1639+
copyOpts := copier.PutOptions{}
1640+
if err := copier.Put(volMount, "", copyOpts, reader); err != nil {
1641+
err2 := <-errChan
1642+
if err2 != nil {
1643+
logrus.Errorf("Error streaming contents of container %s directory for volume copy-up: %v", c.ID(), err2)
1644+
}
1645+
return nil, errors.Wrapf(err, "error copying up to volume %s", vol.Name())
1646+
}
1647+
1648+
if err := <-errChan; err != nil {
1649+
return nil, errors.Wrapf(err, "error streaming container content for copy up into volume %s", vol.Name())
16121650
}
16131651
}
16141652
return vol, nil
@@ -2058,17 +2096,6 @@ func (c *Container) unmount(force bool) error {
20582096
return nil
20592097
}
20602098

2061-
// this should be from chrootarchive.
2062-
// Container MUST be mounted before calling.
2063-
func (c *Container) copyWithTarFromImage(source, dest string) error {
2064-
mappings := idtools.NewIDMappingsFromMaps(c.config.IDMappings.UIDMap, c.config.IDMappings.GIDMap)
2065-
a := archive.NewArchiver(mappings)
2066-
if err := c.copyOwnerAndPerms(source, dest); err != nil {
2067-
return err
2068-
}
2069-
return a.CopyWithTar(source, dest)
2070-
}
2071-
20722099
// checkReadyForRemoval checks whether the given container is ready to be
20732100
// removed.
20742101
// These checks are only used if force-remove is not specified.

libpod/container_internal_linux.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,23 +2261,6 @@ func (c *Container) generatePasswdAndGroup() (string, string, error) {
22612261
return passwdPath, groupPath, nil
22622262
}
22632263

2264-
func (c *Container) copyOwnerAndPerms(source, dest string) error {
2265-
info, err := os.Stat(source)
2266-
if err != nil {
2267-
if os.IsNotExist(err) {
2268-
return nil
2269-
}
2270-
return err
2271-
}
2272-
if err := os.Chmod(dest, info.Mode()); err != nil {
2273-
return err
2274-
}
2275-
if err := os.Chown(dest, int(info.Sys().(*syscall.Stat_t).Uid), int(info.Sys().(*syscall.Stat_t).Gid)); err != nil {
2276-
return err
2277-
}
2278-
return nil
2279-
}
2280-
22812264
// Get cgroup path in a format suitable for the OCI spec
22822265
func (c *Container) getOCICgroupPath() (string, error) {
22832266
unified, err := cgroups.IsCgroup2UnifiedMode()

libpod/define/container_inspect.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ type InspectUlimit struct {
120120
// Name is the name (type) of the ulimit.
121121
Name string `json:"Name"`
122122
// Soft is the soft limit that will be applied.
123-
Soft uint64 `json:"Soft"`
123+
Soft int64 `json:"Soft"`
124124
// Hard is the hard limit that will be applied.
125-
Hard uint64 `json:"Hard"`
125+
Hard int64 `json:"Hard"`
126126
}
127127

128128
// InspectDevice is a single device that will be mounted into the container.

libpod/volume.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,18 @@ func (v *Volume) MountPoint() (string, error) {
130130
if err := v.update(); err != nil {
131131
return "", err
132132
}
133+
}
134+
135+
return v.mountPoint(), nil
136+
}
133137

134-
return v.state.MountPoint, nil
138+
// Internal-only helper for volume mountpoint
139+
func (v *Volume) mountPoint() string {
140+
if v.UsesVolumeDriver() {
141+
return v.state.MountPoint
135142
}
136143

137-
return v.config.MountPoint, nil
144+
return v.config.MountPoint
138145
}
139146

140147
// Options return the volume's options

pkg/domain/infra/abi/images.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,12 +580,21 @@ func (ir *ImageEngine) Remove(ctx context.Context, images []string, opts entitie
580580
// without having to pass all local data around.
581581
deleteImage := func(img *image.Image) error {
582582
results, err := ir.Libpod.RemoveImage(ctx, img, opts.Force)
583-
if err != nil {
583+
switch errors.Cause(err) {
584+
case nil:
585+
// Removal worked, so let's report it.
586+
report.Deleted = append(report.Deleted, results.Deleted)
587+
report.Untagged = append(report.Untagged, results.Untagged...)
588+
return nil
589+
case storage.ErrImageUnknown:
590+
// The image must have been removed already (see #6510).
591+
report.Deleted = append(report.Deleted, img.ID())
592+
report.Untagged = append(report.Untagged, img.ID())
593+
return nil
594+
default:
595+
// Fatal error.
584596
return err
585597
}
586-
report.Deleted = append(report.Deleted, results.Deleted)
587-
report.Untagged = append(report.Untagged, results.Untagged...)
588-
return nil
589598
}
590599

591600
// Delete all images from the local storage.

0 commit comments

Comments
 (0)