Commit graph

2411 commits

Author SHA1 Message Date
Miloslav Trmač 99d9626d71 Fix reporting the registries.conf path on error
i.e. actually reflect the environment variable and/or rootless mode
instead of always using the default path.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:34:59 +01:00
Miloslav Trmač e885311641 Remove manual handling of insecure registries in doPullImage
Instead, just set SystemRegistriesConfPath and let the transport do it.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:34:59 +01:00
Miloslav Trmač 93e14b6198 Remove the forceSecure parameter on the pull call stack
DockerRegistryOptions.DockerInsecureSkipTLSVerify as an types.OptionalBool
can now represent that value, so forceSecure is redundant.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:34:59 +01:00
Miloslav Trmač 1b893be71c Remove manual handling of insecure registries in PushImageToReference
Instead, just set SystemRegistriesConfPath and let the transport do it.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:34:59 +01:00
Miloslav Trmač 8150c942d5 Factor out the registries.conf location code in pkg/registries
The newly introduced SystemRegistriesConfPath somewhat decreases
duplication, but more importantly will allow future callers to
set just a types.SystemContext.SystemRegistriesConfPath and not call
GetRegistries / GetInsecureRegistries at all.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:34:59 +01:00
Miloslav Trmač 7407d6621c Remove the forceSecure parameter of Image.PushImageTo*
DockerRegistryOptions.DockerInsecureSkipTLSVerify as an types.OptionalBool
can now represent that value, so forceSecure is redundant.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:34:59 +01:00
Miloslav Trmač b134951d14 Minimally update for the DockerInsecureSkipTLSVerify type change
Following SystemContext.DockerInsecureSkipTLSVerify, make the
DockerRegistryOne also an OptionalBool, and update callers.

Explicitly document that --tls-verify=true and --tls-verify unset
have different behavior in those commands where the behavior changed
(or where it hasn't changed but the documentation needed updating).

Also make the --tls-verify man page sections a tiny bit more consistent
throughout.

This is a minimal fix, without changing the existing "--tls-verify=true"
paths nor existing manual insecure registry lookups.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:34:59 +01:00
Miloslav Trmač b70f8b3884 Fix build on non-Linux
Unrelated to the rest of the PR.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:31:54 +01:00
Miloslav Trmač 6a0afce7c8 Remove some unused data structures and code
... instead of unnecessarily adapting it for the DockerInsecureSkipTLSVerify type change.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:31:54 +01:00
Miloslav Trmač d3be6b8578 Vendor buildah after merging https://github.com/containers/buildah/pull/1214
This updates buildah for the sysregistriesv2 changes.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:31:54 +01:00
Miloslav Trmač 33fcb355ca Update containers/image to 63a1cbdc5e6537056695cf0d627c0a33b334df53
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:31:54 +01:00
OpenShift Merge Robot d37647ddf8
Merge pull request #1951 from baude/podcontainernet
bind mount /etc/resolv.conf|hosts in pods
2018-12-06 12:50:18 -08:00
OpenShift Merge Robot fb3ceeb385
Merge pull request #1905 from umohnani8/login
Pick registry to login from full image name as well
2018-12-06 12:08:49 -08:00
baude 39a036e24d bind mount /etc/resolv.conf|hosts in pods
containers inside pods need to make sure they get /etc/resolv.conf
and /etc/hosts bind mounted when network is expected

Signed-off-by: baude <bbaude@redhat.com>
2018-12-06 13:56:57 -06:00
OpenShift Merge Robot 5c6e02b55b
Merge pull request #1904 from umohnani8/volume
Add "podman volume" command
2018-12-06 08:59:13 -08:00
OpenShift Merge Robot 3e60de629d
Merge pull request #1912 from baude/prune
Add ability to prune containers and images
2018-12-06 08:31:20 -08:00
OpenShift Merge Robot 99bbbeb746
Merge pull request #1887 from mheon/rm_sync
Add --sync option to podman rm
2018-12-06 08:11:51 -08:00
OpenShift Merge Robot 5a07644646
Merge pull request #1944 from giuseppe/update-tutorial
tutorial: add ostree dependency
2018-12-06 07:20:40 -08:00
OpenShift Merge Robot e04871b13c
Merge pull request #1946 from rhatdan/vendor
Vendor in latest containers/storage
2018-12-06 07:01:42 -08:00
Matthew Heon e5335fd74c Remove --sync flag from podman rm
Per discussion with Dan, it would be better to automatically
handle potential runtime errors by automatically syncing if they
occur. Retaining the flag for `ps` makes sense, as we won't even
be calling the OCI runtime and as such won't see errors if the
state desyncs, but rm can be handled automatically.

The automatic desync handling code will take some additional work
so we'll land this as-is (sync on ps is enough to solve most
desync issues).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
Matthew Heon b945d9128a Add locking to Sync() on containers
Previously not needed as it only worked inside of Batch(), but
now that it can be called anywhere we need to add mutual
exclusion on its config changes.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
Matthew Heon 28bead8be8 Add --sync flag to podman ps
The previous commit added support for --sync to podman rm to
ensure state inconsistencies would not prevent containers from
being removed.

Add the flag to podman ps as well, so that all containers can be
forcibly synced and all state inconsistencies resolved.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
Matthew Heon a0c9be2061 Add --sync option to podman rm
With the changes made recently to ensure Podman does not hit the
OCI runtime as often to sync state, we can find ourselves in a
situation where the runtime's state does not match ours.

Add a --sync flag to podman rm to ensure we can still remove
containers when this happens.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
Urvashi Mohnani 375831e976 Tests for podman volume commands
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2018-12-06 10:17:23 +00:00
umohnani8 4c70b8a94b Add "podman volume" command
Add support for podman volume and its subcommands.
The commands supported are:
	podman volume create
	podman volume inspect
	podman volume ls
	podman volume rm
	podman volume prune

This is a tool to manage volumes used by podman. For now it only handle
named volumes, but eventually it will handle all volumes used by podman.

Signed-off-by: umohnani8 <umohnani@redhat.com>
2018-12-06 10:17:16 +00:00
Giuseppe Scrivano 0a838fc239
tutorial: add ostree dependency
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-06 11:13:56 +01:00
Urvashi Mohnani a75b397ac1 Pick registry to login from full image name as well
podman login reg.io/username/image works as well now. It picks
the registry and checks for authentication, if none exist it
will prompt for username and password.
If the credentials exist but are not valid, it will prompt the
user for new valid credentials.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2018-12-06 09:33:16 +00:00
Daniel J Walsh fe7f3e4094
Merge branch 'vendor' of github.com:rhatdan/libpod into vendor 2018-12-06 03:20:31 -05:00
Daniel J Walsh 40678b119c
Merge branch 'master' of github.com:containers/libpod into vendor 2018-12-06 03:20:16 -05:00
baude e037427035 Add ability to prune containers and images
Allow user to prune unused/unnamed images, the layer images from building,
via podman rmi --prune.

Allow user to prune stopped/exiuted containers via podman rm --prune.

This should resolve #1910

Signed-off-by: baude <bbaude@redhat.com>
2018-12-05 19:57:54 -06:00
OpenShift Merge Robot 75b19ca8ab
Merge pull request #1945 from jwhonce/bug/1929
Invert tlsverify default in API
2018-12-05 17:20:17 -08:00
OpenShift Merge Robot 6bb56a1c97
Merge pull request #1924 from baude/mroevarlinkendpoints
Adding more varlink endpoints
2018-12-05 14:55:27 -08:00
Jhon Honce 7c7231ce01 Invert tlsverify default in API
Fixes #1929

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-12-05 15:42:33 -07:00
OpenShift Merge Robot bbcbf03f73
Merge pull request #1947 from baude/f28runc
set .54 version for f28 due to memory error
2018-12-05 14:36:38 -08:00
baude ab4a3ece40 set .54 version for f28 due to memory error
Signed-off-by: baude <bbaude@redhat.com>
2018-12-05 15:18:29 -06:00
Daniel J Walsh 5f480f5f75
Vendor in latest containers/storage
This should improve performance on vfs images on top of xfs/reflink drives.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-05 15:56:04 -05:00
OpenShift Merge Robot be74acee1c
Merge pull request #1940 from wking/numeric-gid
libpod/container_internal_linux: Allow gids that aren't in the group file
2018-12-05 08:09:58 -08:00
OpenShift Merge Robot 50e754cd57
Merge pull request #1918 from mheon/use_db_paths
Use paths written in DB instead if they differ from our defaults
2018-12-05 00:55:48 -08:00
W. Trevor King 39df2093e8 pkg/lookup: Return ID-only pointers on ErrNo*Entries
Callers that only care about the IDs should try to convert the
identifier to an integer before calling the Get* functions, so they
can save the cost of hitting the filesystem and maybe or maybe not
finding the other fields (User.Name, etc.).  But callers that *want*
the other fields but only actually need the ID can, with this commit,
just call the Get* function and ignore ErrNo*Entries responses:

  user, err := lookup.GetUser(mount, userIDorName)
  if err != nil && err != ErrNoPasswdEntries {
    return err
  }

Previously, they'd have to perform their own integer-conversion
attempt in Get* error handling, with logic like:

  user, err := lookup.GetUser(mount, userIDorName)
  if err == ErrNoPasswdEntries {
    uuid, err := strconv.ParseUint(userIDorName, 10, 32)
    if err == nil {
      user.Uid = int(uuid)
    }
  } else if err != nil {
    return err
  }

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-12-04 14:46:43 -08:00
OpenShift Merge Robot 320085a04d
Merge pull request #1942 from baude/rmi_test
test for rmi with children
2018-12-04 13:13:57 -08:00
OpenShift Merge Robot aba52cf588
Merge pull request #1939 from mheon/no_firewall_if_rootless
Don't initialize CNI when running as rootless
2018-12-04 12:55:40 -08:00
baude 0cd83466db test for rmi with children
Signed-off-by: baude <bbaude@redhat.com>
2018-12-04 14:22:11 -06:00
OpenShift Merge Robot b81f640bb5
Merge pull request #1920 from wking/explicit-hooks-dirs
libpod/container_internal: Deprecate implicit hook directories
2018-12-04 12:19:48 -08:00
OpenShift Merge Robot a01a590ae8
Merge pull request #1933 from giuseppe/update-runc-again
test: update runc again
2018-12-04 12:08:20 -08:00
OpenShift Merge Robot f1770ea0ef
Merge pull request #1932 from giuseppe/vendor-storage
vendor: update containers/storage
2018-12-04 12:08:11 -08:00
W. Trevor King 650f95cb06 libpod/container_internal_linux: Allow gids that aren't in the group file
When an image config sets config.User [1] to a numeric group (like
1000:1000), but those values do not exist in the container's
/etc/group, libpod is currently breaking:

  $ podman run --rm registry.svc.ci.openshift.org/ci-op-zvml7cd6/pipeline:installer --help
  error creating temporary passwd file for container 228f6e9943d6f18b93c19644e9b619ec4d459a3e0eb31680e064eeedf6473678: unable to get gid 1000 from group file: no matching entries in group file

However, the OCI spec requires converters to copy numeric uid and gid
to the runtime config verbatim [2].

With this commit, I'm frontloading the "is groupspec an integer?"
check and only bothering with lookup.GetGroup when it was not.

I've also removed a few .Mounted checks, which are originally from
00d38cb3 (podman create/run need to load information from the image,
2017-12-18, #110).  We don't need a mounted container filesystem to
translate integers.  And when the lookup code needs to fall back to
the mounted root to translate names, it can handle erroring out
internally (and looking it over, it seems to do that already).

[1]: https://github.com/opencontainers/image-spec/blame/v1.0.1/config.md#L118-L123
[2]: https://github.com/opencontainers/image-spec/blame/v1.0.1/conversion.md#L70

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-12-04 12:00:42 -08:00
Matthew Heon 32aa45e344 Don't initialize CNI when running as rootless
We don't use CNI to configure networks for rootless containers,
so no need to set it up. It may also cause issues with inotify,
so disabling it resolves some potential problems.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-04 14:57:06 -05:00
OpenShift Merge Robot f31c1c8c09
Merge pull request #1938 from baude/rmichildren
correct algorithm for deleting all images
2018-12-04 11:50:15 -08:00
baude 41a7bd9c9e correct algorithm for deleting all images
when deleting all images, we need to iterate all the images deleting on those who dont
have children first. And then reiterate until they are all gone.

This resolves #1926

Signed-off-by: baude <bbaude@redhat.com>
2018-12-04 13:13:54 -06:00
Matthew Heon e3882cfa2d Use runtime lockDir in BoltDB state
Instead of storing the runtime's file lock dir in the BoltDB
state, refer to the runtime inside the Bolt state instead, and
use the path stored in the runtime.

This is necessary since we moved DB initialization very far up in
runtime init, before the locks dir is properly initialized (and
it must happen before the locks dir can be created, as we use the
DB to retrieve the proper path for the locks dir now).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-04 13:58:51 -05:00