diff options
author | baude <bbaude@redhat.com> | 2018-08-02 08:58:59 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-08-06 14:49:11 +0000 |
commit | bd9d3a8fa5843dca49a4903d66f603f678ed0fa5 (patch) | |
tree | d5122665394c94133530e0cbc3ee783fb0441839 | |
parent | ee89bc46eb4d27176977174d08893188b13228b7 (diff) | |
download | podman-bd9d3a8fa5843dca49a4903d66f603f678ed0fa5.tar.gz podman-bd9d3a8fa5843dca49a4903d66f603f678ed0fa5.tar.bz2 podman-bd9d3a8fa5843dca49a4903d66f603f678ed0fa5.zip |
Rename varlink socket and interface
io.projectatomic.podman -> io.podman
Signed-off-by: baude <bbaude@redhat.com>
Closes: #1204
Approved by: mheon
24 files changed, 142 insertions, 142 deletions
@@ -1,4 +1,4 @@ -# io.projectatomic.podman +# io.podman Podman Service Interface and API description. The master version of this document can be found in the [API.md](https://github.com/projectatomic/libpod/blob/master/API.md) file in the upstream libpod repository. ## Index @@ -174,7 +174,7 @@ input required for CreateContainer is an image name. If the image name is not f error will be returned. Otherwise, the ID of the newly created container will be returned. #### Example ~~~ -$ varlink call unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.CreateContainer '{"create": {"image": "alpine"}}' +$ varlink call unix:/run/podman/io.podman/io.podman.CreateContainer '{"create": {"image": "alpine"}}' { "container": "8759dafbc0a4dc3bcfb57eeb72e4331eb73c5cc09ab968e65ce45b9ad5c4b6bb" } @@ -223,7 +223,7 @@ second is a "control" socket where things like resizing the TTY events are sent. found, a [ContainerNotFound](#ContainerNotFound) error will be returned. #### Example ~~~ -$ varlink call -m unix:/run/io.projectatomic.podman/io.projectatomic.podman.GetAttachSockets '{"name": "b7624e775431219161"}' +$ varlink call -m unix:/run/io.podman/io.podman.GetAttachSockets '{"name": "b7624e775431219161"}' { "sockets": { "container_id": "b7624e7754312191613245ce1a46844abee60025818fe3c3f3203435623a1eca", @@ -256,7 +256,7 @@ contains attributes like memory and cpu usage. If the container cannot be found [ContainerNotFound](#ContainerNotFound) error will be returned. #### Example ~~~ -$ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.GetContainerStats '{"name": "c33e4164f384"}' +$ varlink call -m unix:/run/podman/io.podman/io.podman.GetContainerStats '{"name": "c33e4164f384"}' { "container": { "block_input": 0, @@ -344,7 +344,7 @@ arguments that represent ps options. If the container cannot be found, a [Conta error will be returned. #### Example ~~~ -$ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.ListContainerProcesses '{"name": "135d71b9495f", "opts": []}' +$ varlink call -m unix:/run/podman/io.podman/io.podman.ListContainerProcesses '{"name": "135d71b9495f", "opts": []}' { "container": [ " UID PID PPID C STIME TTY TIME CMD", @@ -380,7 +380,7 @@ method Ping() [StringResponse](#StringResponse)</div> Ping provides a response for developers to ensure their varlink setup is working. #### Example ~~~ -$ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.Ping +$ varlink call -m unix:/run/podman/io.podman/io.podman.Ping { "ping": { "message": "OK" @@ -395,7 +395,7 @@ PullImage pulls an image from a repository to local storage. After the pull is is returned. #### Example ~~~ -$ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.PullImage '{"name": "registry.fedoraproject.org/fedora"}' +$ varlink call -m unix:/run/podman/io.podman/io.podman.PullImage '{"name": "registry.fedoraproject.org/fedora"}' { "id": "426866d6fa419873f97e5cbd320eeb22778244c1dfffa01c944db3114f55772e" } @@ -416,7 +416,7 @@ container can be stopped and removed. Upon successful removal of the container, container cannot be found by name or ID, a [ContainerNotFound](#ContainerNotFound) error will be returned. #### Example ~~~ -$ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.RemoveContainer '{"name": "62f4fd98cb57"}' +$ varlink call -m unix:/run/podman/io.podman/io.podman.RemoveContainer '{"name": "62f4fd98cb57"}' { "container": "62f4fd98cb57f529831e8f90610e54bba74bd6f02920ffb485e15376ed365c20" } @@ -430,7 +430,7 @@ should be deleted. If the image cannot be found, an [ImageNotFound](#ImageNotFo ID of the removed image is returned when complete. See also [DeleteUnusedImages](DeleteUnusedImages). #### Example ~~~ -varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.RemoveImage '{"name": "registry.fedoraproject.org/fedora", "force": true}' +varlink call -m unix:/run/podman/io.podman/io.podman.RemoveImage '{"name": "registry.fedoraproject.org/fedora", "force": true}' { "image": "426866d6fa419873f97e5cbd320eeb22778244c1dfffa01c944db3114f55772e" } @@ -477,7 +477,7 @@ returns the container ID once stopped. If the container cannot be found, a [Cont error will be returned instead. See also [KillContainer](KillContainer). #### Error ~~~ -$ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.StopContainer '{"name": "135d71b9495f", "timeout": 5}' +$ varlink call -m unix:/run/podman/io.podman/io.podman.StopContainer '{"name": "135d71b9495f", "timeout": 5}' { "container": "135d71b9495f7c3967f536edad57750bfdb569336cd107d8aabab45565ffcfb6" } @@ -20,7 +20,7 @@ SYSTEMDDIR ?= ${PREFIX}/lib/systemd/system BUILDTAGS ?= seccomp $(shell hack/btrfs_tag.sh) $(shell hack/libdm_tag.sh) $(shell hack/btrfs_installed_tag.sh) $(shell hack/ostree_tag.sh) $(shell hack/selinux_tag.sh) $(shell hack/apparmor_tag.sh) varlink BUILDTAGS_CROSS ?= containers_image_openpgp containers_image_ostree_stub exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_graphdriver_overlay ifneq (,$(findstring varlink,$(BUILDTAGS))) - PODMAN_VARLINK_DEPENDENCIES = cmd/podman/varlink/ioprojectatomicpodman.go + PODMAN_VARLINK_DEPENDENCIES = cmd/podman/varlink/iopodman.go endif PYTHON ?= /usr/bin/python3 @@ -131,7 +131,7 @@ clean: test/checkseccomp/checkseccomp \ test/copyimg/copyimg \ test/testdata/redis-image \ - cmd/podman/varlink/ioprojectatomicpodman.go \ + cmd/podman/varlink/iopodman.go \ $(MANPAGES) ||: ifdef HAS_PYTHON3 $(MAKE) -C contrib/python/podman clean @@ -235,8 +235,8 @@ install.docker: docker-docs install ${SELINUXOPT} -m 644 docs/docker*.1 -t $(MANDIR)/man1 install.systemd: - install ${SELINUXOPT} -m 644 -D contrib/varlink/io.projectatomic.podman.socket ${SYSTEMDDIR}/io.projectatomic.podman.socket - install ${SELINUXOPT} -m 644 -D contrib/varlink/io.projectatomic.podman.service ${SYSTEMDDIR}/io.projectatomic.podman.service + install ${SELINUXOPT} -m 644 -D contrib/varlink/io.podman.socket ${SYSTEMDDIR}/io.podman.socket + install ${SELINUXOPT} -m 644 -D contrib/varlink/io.podman.service ${SYSTEMDDIR}/io.podman.service install ${SELINUXOPT} -m 644 -D contrib/varlink/podman.conf ${TMPFILESDIR}/podman.conf install.python: @@ -288,7 +288,7 @@ install.tools: .install.gitvalidation .install.gometalinter .install.md2man make all install; \ fi -varlink_generate: .gopathok cmd/podman/varlink/ioprojectatomicpodman.go +varlink_generate: .gopathok cmd/podman/varlink/iopodman.go varlink_api_generate: .gopathok API.md .PHONY: install.libseccomp.sudo @@ -298,10 +298,10 @@ install.libseccomp.sudo: cd ../../seccomp/libseccomp && git checkout $(LIBSECCOMP_COMMIT) && ./autogen.sh && ./configure --prefix=/usr && make all && make install -cmd/podman/varlink/ioprojectatomicpodman.go: cmd/podman/varlink/io.projectatomic.podman.varlink +cmd/podman/varlink/iopodman.go: cmd/podman/varlink/io.podman.varlink $(GO) generate ./cmd/podman/varlink/... -API.md: cmd/podman/varlink/io.projectatomic.podman.varlink +API.md: cmd/podman/varlink/io.podman.varlink $(GO) generate ./docs/... validate: gofmt .gitvalidation diff --git a/cmd/podman/varlink.go b/cmd/podman/varlink.go index ae36ba1e7..71cf86c74 100644 --- a/cmd/podman/varlink.go +++ b/cmd/podman/varlink.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" "github.com/projectatomic/libpod/cmd/podman/libpodruntime" - ioprojectatomicpodman "github.com/projectatomic/libpod/cmd/podman/varlink" + iopodman "github.com/projectatomic/libpod/cmd/podman/varlink" "github.com/projectatomic/libpod/pkg/varlinkapi" "github.com/projectatomic/libpod/version" "github.com/sirupsen/logrus" @@ -52,7 +52,7 @@ func varlinkCmd(c *cli.Context) error { } defer runtime.Shutdown(false) - var varlinkInterfaces = []*ioprojectatomicpodman.VarlinkInterface{varlinkapi.New(c, runtime)} + var varlinkInterfaces = []*iopodman.VarlinkInterface{varlinkapi.New(c, runtime)} // Register varlink service. The metadata can be retrieved with: // $ varlink info [varlink address URI] service, err := varlink.NewService( diff --git a/cmd/podman/varlink/generate.go b/cmd/podman/varlink/generate.go index b07f8b06b..2fa2d8e23 100644 --- a/cmd/podman/varlink/generate.go +++ b/cmd/podman/varlink/generate.go @@ -1,3 +1,3 @@ -package ioprojectatomicpodman +package iopodman -//go:generate go run ../../../vendor/github.com/varlink/go/cmd/varlink-go-interface-generator/main.go io.projectatomic.podman.varlink +//go:generate go run ../../../vendor/github.com/varlink/go/cmd/varlink-go-interface-generator/main.go io.podman.varlink diff --git a/cmd/podman/varlink/io.projectatomic.podman.varlink b/cmd/podman/varlink/io.podman.varlink index fdc941e1a..da6739d69 100644 --- a/cmd/podman/varlink/io.projectatomic.podman.varlink +++ b/cmd/podman/varlink/io.podman.varlink @@ -1,6 +1,6 @@ # Podman Service Interface and API description. The master version of this document can be found # in the [API.md](https://github.com/projectatomic/libpod/blob/master/API.md) file in the upstream libpod repository. -interface io.projectatomic.podman +interface io.podman # Version is the structure returned by GetVersion @@ -329,7 +329,7 @@ type BuildResponse ( # Ping provides a response for developers to ensure their varlink setup is working. # #### Example # ~~~ -# $ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.Ping +# $ varlink call -m unix:/run/podman/io.podman/io.podman.Ping # { # "ping": { # "message": "OK" @@ -360,7 +360,7 @@ method GetContainer(name: string) -> (container: ListContainerData) # error will be returned. Otherwise, the ID of the newly created container will be returned. # #### Example # ~~~ -# $ varlink call unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.CreateContainer '{"create": {"image": "alpine"}}' +# $ varlink call unix:/run/podman/io.podman/io.podman.CreateContainer '{"create": {"image": "alpine"}}' # { # "container": "8759dafbc0a4dc3bcfb57eeb72e4331eb73c5cc09ab968e65ce45b9ad5c4b6bb" # } @@ -378,7 +378,7 @@ method InspectContainer(name: string) -> (container: string) # error will be returned. # #### Example # ~~~ -# $ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.ListContainerProcesses '{"name": "135d71b9495f", "opts": []}' +# $ varlink call -m unix:/run/podman/io.podman/io.podman.ListContainerProcesses '{"name": "135d71b9495f", "opts": []}' # { # "container": [ # " UID PID PPID C STIME TTY TIME CMD", @@ -412,7 +412,7 @@ method ExportContainer(name: string, path: string) -> (tarfile: string) # [ContainerNotFound](#ContainerNotFound) error will be returned. # #### Example # ~~~ -# $ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.GetContainerStats '{"name": "c33e4164f384"}' +# $ varlink call -m unix:/run/podman/io.podman/io.podman.GetContainerStats '{"name": "c33e4164f384"}' # { # "container": { # "block_input": 0, @@ -447,7 +447,7 @@ method StartContainer(name: string) -> (container: string) # error will be returned instead. See also [KillContainer](KillContainer). # #### Error # ~~~ -# $ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.StopContainer '{"name": "135d71b9495f", "timeout": 5}' +# $ varlink call -m unix:/run/podman/io.podman/io.podman.StopContainer '{"name": "135d71b9495f", "timeout": 5}' # { # "container": "135d71b9495f7c3967f536edad57750bfdb569336cd107d8aabab45565ffcfb6" # } @@ -490,7 +490,7 @@ method AttachToContainer() -> (notimplemented: NotImplemented) # found, a [ContainerNotFound](#ContainerNotFound) error will be returned. # #### Example # ~~~ -# $ varlink call -m unix:/run/io.projectatomic.podman/io.projectatomic.podman.GetAttachSockets '{"name": "b7624e775431219161"}' +# $ varlink call -m unix:/run/io.podman/io.podman.GetAttachSockets '{"name": "b7624e775431219161"}' # { # "sockets": { # "container_id": "b7624e7754312191613245ce1a46844abee60025818fe3c3f3203435623a1eca", @@ -511,7 +511,7 @@ method WaitContainer(name: string) -> (exitcode: int) # container cannot be found by name or ID, a [ContainerNotFound](#ContainerNotFound) error will be returned. # #### Example # ~~~ -# $ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.RemoveContainer '{"name": "62f4fd98cb57"}' +# $ varlink call -m unix:/run/podman/io.podman/io.podman.RemoveContainer '{"name": "62f4fd98cb57"}' # { # "container": "62f4fd98cb57f529831e8f90610e54bba74bd6f02920ffb485e15376ed365c20" # } @@ -562,7 +562,7 @@ method TagImage(name: string, tagged: string) -> (image: string) # ID of the removed image is returned when complete. See also [DeleteUnusedImages](DeleteUnusedImages). # #### Example # ~~~ -# varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.RemoveImage '{"name": "registry.fedoraproject.org/fedora", "force": true}' +# varlink call -m unix:/run/podman/io.podman/io.podman.RemoveImage '{"name": "registry.fedoraproject.org/fedora", "force": true}' # { # "image": "426866d6fa419873f97e5cbd320eeb22778244c1dfffa01c944db3114f55772e" # } @@ -602,7 +602,7 @@ method ExportImage(name: string, destination: string, compress: bool, tags: []st # is returned. # #### Example # ~~~ -# $ varlink call -m unix:/run/podman/io.projectatomic.podman/io.projectatomic.podman.PullImage '{"name": "registry.fedoraproject.org/fedora"}' +# $ varlink call -m unix:/run/podman/io.podman/io.podman.PullImage '{"name": "registry.fedoraproject.org/fedora"}' # { # "id": "426866d6fa419873f97e5cbd320eeb22778244c1dfffa01c944db3114f55772e" # } diff --git a/contrib/python/podman/examples/run_example.sh b/contrib/python/podman/examples/run_example.sh index 0f6575073..d81ddf456 100755 --- a/contrib/python/podman/examples/run_example.sh +++ b/contrib/python/podman/examples/run_example.sh @@ -22,8 +22,8 @@ if [[ $(id -u) != 0 ]]; then exit 2 fi -if ! systemctl --quiet is-active io.projectatomic.podman.socket; then - echo 1>&2 'podman is not running. systemctl enable --now io.projectatomic.podman.socket' +if ! systemctl --quiet is-active io.podman.socket; then + echo 1>&2 'podman is not running. systemctl enable --now io.podman.socket' exit 1 fi diff --git a/contrib/python/podman/podman/client.py b/contrib/python/podman/podman/client.py index fedd9310e..327bfdee2 100644 --- a/contrib/python/podman/podman/client.py +++ b/contrib/python/podman/podman/client.py @@ -31,7 +31,7 @@ class BaseClient(): @classmethod def factory(cls, uri=None, - interface='io.projectatomic.podman', + interface='io.podman', *args, **kwargs): """Construct a Client based on input.""" @@ -153,18 +153,18 @@ class Client(): >>> import podman >>> c = podman.Client(uri='unix:/tmp/podman.sock', - remote_uri='ssh://user@host/run/podman/io.projectatomic.podman', + remote_uri='ssh://user@host/run/podman/io.podman', identity_file='~/.ssh/id_rsa') """ def __init__(self, - uri='unix:/run/podman/io.projectatomic.podman', - interface='io.projectatomic.podman', + uri='unix:/run/podman/io.podman', + interface='io.podman', **kwargs): """Construct a podman varlink Client. uri from default systemd unit file. - interface from io.projectatomic.podman.varlink, do not change unless + interface from io.podman.varlink, do not change unless you are a varlink guru. """ self._client = BaseClient.factory(uri, interface, **kwargs) diff --git a/contrib/python/podman/podman/libs/errors.py b/contrib/python/podman/podman/libs/errors.py index d34577a57..9d7559c84 100644 --- a/contrib/python/podman/podman/libs/errors.py +++ b/contrib/python/podman/podman/libs/errors.py @@ -50,10 +50,10 @@ class PodmanError(VarlinkErrorProxy): ERROR_MAP = { - 'io.projectatomic.podman.ContainerNotFound': ContainerNotFound, - 'io.projectatomic.podman.ErrorOccurred': ErrorOccurred, - 'io.projectatomic.podman.ImageNotFound': ImageNotFound, - 'io.projectatomic.podman.RuntimeError': PodmanError, + 'io.podman.ContainerNotFound': ContainerNotFound, + 'io.podman.ErrorOccurred': ErrorOccurred, + 'io.podman.ImageNotFound': ImageNotFound, + 'io.podman.RuntimeError': PodmanError, } diff --git a/contrib/python/podman/test/test_client.py b/contrib/python/podman/test/test_client.py index d36cb1a43..3fc6d39dc 100644 --- a/contrib/python/podman/test/test_client.py +++ b/contrib/python/podman/test/test_client.py @@ -15,7 +15,7 @@ class TestClient(unittest.TestCase): def test_local(self, mock_ping): p = Client( uri='unix:/run/podman', - interface='io.projectatomic.podman', + interface='io.podman', ) self.assertIsInstance(p._client, LocalClient) @@ -27,7 +27,7 @@ class TestClient(unittest.TestCase): def test_remote(self, mock_ping): p = Client( uri='unix:/run/podman', - interface='io.projectatomic.podman', + interface='io.podman', remote_uri='ssh://user@hostname/run/podman/podman', identity_file='~/.ssh/id_rsa') diff --git a/contrib/python/podman/test/test_runner.sh b/contrib/python/podman/test/test_runner.sh index 17dd2a30c..a9142d36d 100755 --- a/contrib/python/podman/test/test_runner.sh +++ b/contrib/python/podman/test/test_runner.sh @@ -106,7 +106,7 @@ RUN chmod 755 /tmp/hello.sh ENTRYPOINT ["/tmp/hello.sh"] EOT -export PODMAN_HOST="unix:${TMPDIR}/podman/io.projectatomic.podman" +export PODMAN_HOST="unix:${TMPDIR}/podman/io.podman" PODMAN_ARGS="--storage-driver=vfs \ --root=${TMPDIR}/crio \ --runroot=${TMPDIR}/crio-run \ diff --git a/contrib/python/podman/test/test_tunnel.py b/contrib/python/podman/test/test_tunnel.py index cdcc8466a..8ee4b1052 100644 --- a/contrib/python/podman/test/test_tunnel.py +++ b/contrib/python/podman/test/test_tunnel.py @@ -56,7 +56,7 @@ class TestTunnel(unittest.TestCase): context = Context( 'unix:/01', - 'io.projectatomic.podman', + 'io.podman', '/tmp/user/socket', '/run/podman/socket', 'user', diff --git a/contrib/python/pypodman/docs/man1/pypodman.1 b/contrib/python/pypodman/docs/man1/pypodman.1 index 7c4816062..09acb205b 100644 --- a/contrib/python/pypodman/docs/man1/pypodman.1 +++ b/contrib/python/pypodman/docs/man1/pypodman.1 @@ -54,7 +54,7 @@ Default is None and will allow \f[C]ssh\f[] to follow it's default configuration \f[B]\[en]remote\-socket\-path\f[] .PP Path on remote host for podman service's \f[C]AF_UNIX\f[] socket. The default is -\f[C]/run/podman/io.projectatomic.podman\f[]. +\f[C]/run/podman/io.podman\f[]. .PP \f[B]\[en]identity\-file\f[] .PP @@ -92,7 +92,7 @@ From command line option, for example: \[en]run\-dir This should provide Operators the ability to setup basic configurations and allow users to customize them. .PP -\f[B]XDG_RUNTIME_DIR\f[] (\f[C]XDG_RUNTIME_DIR/io.projectatomic.podman\f[]) +\f[B]XDG_RUNTIME_DIR\f[] (\f[C]XDG_RUNTIME_DIR/io.podman\f[]) .PP Directory where pypodman stores non\-essential runtime files and other file objects (such as sockets, named pipes, \&...). diff --git a/contrib/python/pypodman/pypodman/lib/config.py b/contrib/python/pypodman/pypodman/lib/config.py index 137ffdb34..0d5004b9d 100644 --- a/contrib/python/pypodman/pypodman/lib/config.py +++ b/contrib/python/pypodman/pypodman/lib/config.py @@ -101,7 +101,7 @@ class PodmanArgumentParser(argparse.ArgumentParser): '--remote-socket-path', metavar='PATH', help=('path of podman socket on remote host' - ' (default: /run/podman/io.projectatomic.podman)')) + ' (default: /run/podman/io.podman)')) self.add_argument( '--identity-file', '-i', @@ -198,7 +198,7 @@ class PodmanArgumentParser(argparse.ArgumentParser): getattr(args, 'remote_socket_path') or os.environ.get('REMOTE_SOCKET_PATH') or config['default'].get('remote_socket_path') - or '/run/podman/io.projectatomic.podman' + or '/run/podman/io.podman' ) # yapf:disable reqattr( diff --git a/contrib/varlink/io.podman.service b/contrib/varlink/io.podman.service new file mode 100644 index 000000000..c524ce815 --- /dev/null +++ b/contrib/varlink/io.podman.service @@ -0,0 +1,13 @@ +[Unit] +Description=Podman Remote API Service +Requires=io.podman.socket +After=io.podman.socket +Documentation=man:podman-varlink(1) + +[Service] +Type=simple +ExecStart=/usr/bin/podman varlink unix:/run/podman/io.podman + +[Install] +WantedBy=multi-user.target +Also=io.podman.socket diff --git a/contrib/varlink/io.projectatomic.podman.socket b/contrib/varlink/io.podman.socket index bd82c4240..0f09fe3ef 100644 --- a/contrib/varlink/io.projectatomic.podman.socket +++ b/contrib/varlink/io.podman.socket @@ -3,7 +3,7 @@ Description=Podman Remote API Socket Documentation=man:podman-varlink(1) [Socket] -ListenStream=/run/podman/io.projectatomic.podman +ListenStream=/run/podman/io.podman SocketMode=0600 [Install] diff --git a/contrib/varlink/io.projectatomic.podman.service b/contrib/varlink/io.projectatomic.podman.service deleted file mode 100644 index 1c4c1435f..000000000 --- a/contrib/varlink/io.projectatomic.podman.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Podman Remote API Service -Requires=io.projectatomic.podman.socket -After=io.projectatomic.podman.socket -Documentation=man:podman-varlink(1) - -[Service] -Type=simple -ExecStart=/usr/bin/podman varlink unix:/run/podman/io.projectatomic.podman - -[Install] -WantedBy=multi-user.target -Also=io.projectatomic.podman.socket diff --git a/docs/generate.go b/docs/generate.go index 405d8c83f..9ab370e2c 100644 --- a/docs/generate.go +++ b/docs/generate.go @@ -1,3 +1,3 @@ package docs -//go:generate go run varlink/apidoc.go ../cmd/podman/varlink/io.projectatomic.podman.varlink ../API.md +//go:generate go run varlink/apidoc.go ../cmd/podman/varlink/io.podman.varlink ../API.md diff --git a/docs/podman-varlink.1.md b/docs/podman-varlink.1.md index d53457e22..cd57e8b45 100644 --- a/docs/podman-varlink.1.md +++ b/docs/podman-varlink.1.md @@ -26,24 +26,24 @@ second. A value of `0` means no timeout and the session will not expire. Run the podman varlink service manually and accept the default timeout. ``` -# podman varlink unix:/run/podman/io.projectatomic.podman +$ podman varlink unix:/run/podman/io.podman ``` Run the podman varlink service manually with a 5 second timeout. ``` -# podman varlink --timeout 5000 unix:/run/podman/io.projectatomic.podman +$ podman varlink --timeout 5000 unix:/run/podman/io.podman ``` ## CONFIGURATION -Users of the podman varlink service should enable the _io.projectatomic.podman.socket_ and _io.projectatomic.podman.service_. +Users of the podman varlink service should enable the _io.podman.socket_ and _io.podman.service_. This is the preferred method for running the varlink service. You can do this via systemctl. ``` -# systemctl enable --now io.projectatomic.podman.socket +systemctl enable --now io.podman.socket ``` ## SEE ALSO diff --git a/pkg/varlinkapi/config.go b/pkg/varlinkapi/config.go index 2da3787be..fa1983463 100644 --- a/pkg/varlinkapi/config.go +++ b/pkg/varlinkapi/config.go @@ -1,7 +1,7 @@ package varlinkapi import ( - ioprojectatomicpodman "github.com/projectatomic/libpod/cmd/podman/varlink" + iopodman "github.com/projectatomic/libpod/cmd/podman/varlink" "github.com/projectatomic/libpod/libpod" "github.com/urfave/cli" ) @@ -9,12 +9,12 @@ import ( // LibpodAPI is the basic varlink struct for libpod type LibpodAPI struct { Cli *cli.Context - ioprojectatomicpodman.VarlinkInterface + iopodman.VarlinkInterface Runtime *libpod.Runtime } // New creates a new varlink client -func New(cli *cli.Context, runtime *libpod.Runtime) *ioprojectatomicpodman.VarlinkInterface { +func New(cli *cli.Context, runtime *libpod.Runtime) *iopodman.VarlinkInterface { lp := LibpodAPI{Cli: cli, Runtime: runtime} - return ioprojectatomicpodman.VarlinkNew(&lp) + return iopodman.VarlinkNew(&lp) } diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go index 82cd135c3..f42386194 100644 --- a/pkg/varlinkapi/containers.go +++ b/pkg/varlinkapi/containers.go @@ -17,9 +17,9 @@ import ( ) // ListContainers ... -func (i *LibpodAPI) ListContainers(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) ListContainers(call iopodman.VarlinkCall) error { var ( - listContainers []ioprojectatomicpodman.ListContainerData + listContainers []iopodman.ListContainerData ) containers, err := i.Runtime.GetAllContainers() @@ -42,7 +42,7 @@ func (i *LibpodAPI) ListContainers(call ioprojectatomicpodman.VarlinkCall) error } // GetContainer ... -func (i *LibpodAPI) GetContainer(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) GetContainer(call iopodman.VarlinkCall, name string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -59,7 +59,7 @@ func (i *LibpodAPI) GetContainer(call ioprojectatomicpodman.VarlinkCall, name st } // InspectContainer ... -func (i *LibpodAPI) InspectContainer(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) InspectContainer(call iopodman.VarlinkCall, name string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -80,7 +80,7 @@ func (i *LibpodAPI) InspectContainer(call ioprojectatomicpodman.VarlinkCall, nam } // ListContainerProcesses ... -func (i *LibpodAPI) ListContainerProcesses(call ioprojectatomicpodman.VarlinkCall, name string, opts []string) error { +func (i *LibpodAPI) ListContainerProcesses(call iopodman.VarlinkCall, name string, opts []string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -107,7 +107,7 @@ func (i *LibpodAPI) ListContainerProcesses(call ioprojectatomicpodman.VarlinkCal } // GetContainerLogs ... -func (i *LibpodAPI) GetContainerLogs(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) GetContainerLogs(call iopodman.VarlinkCall, name string) error { var logs []string ctr, err := i.Runtime.LookupContainer(name) if err != nil { @@ -168,12 +168,12 @@ func (i *LibpodAPI) GetContainerLogs(call ioprojectatomicpodman.VarlinkCall, nam } // ListContainerChanges ... -func (i *LibpodAPI) ListContainerChanges(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) ListContainerChanges(call iopodman.VarlinkCall, name string) error { changes, err := i.Runtime.GetDiff("", name) if err != nil { return call.ReplyErrorOccurred(err.Error()) } - result := ioprojectatomicpodman.ContainerChanges{} + result := iopodman.ContainerChanges{} for _, change := range changes { switch change.Kind { case archive.ChangeModify: @@ -188,7 +188,7 @@ func (i *LibpodAPI) ListContainerChanges(call ioprojectatomicpodman.VarlinkCall, } // ExportContainer ... -func (i *LibpodAPI) ExportContainer(call ioprojectatomicpodman.VarlinkCall, name, path string) error { +func (i *LibpodAPI) ExportContainer(call iopodman.VarlinkCall, name, path string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -200,7 +200,7 @@ func (i *LibpodAPI) ExportContainer(call ioprojectatomicpodman.VarlinkCall, name } // GetContainerStats ... -func (i *LibpodAPI) GetContainerStats(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) GetContainerStats(call iopodman.VarlinkCall, name string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -209,7 +209,7 @@ func (i *LibpodAPI) GetContainerStats(call ioprojectatomicpodman.VarlinkCall, na if err != nil { return call.ReplyErrorOccurred(err.Error()) } - cs := ioprojectatomicpodman.ContainerStats{ + cs := iopodman.ContainerStats{ Id: ctr.ID(), Name: ctr.Name(), Cpu: containerStats.CPU, @@ -228,12 +228,12 @@ func (i *LibpodAPI) GetContainerStats(call ioprojectatomicpodman.VarlinkCall, na } // ResizeContainerTty ... -func (i *LibpodAPI) ResizeContainerTty(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) ResizeContainerTty(call iopodman.VarlinkCall) error { return call.ReplyMethodNotImplemented("ResizeContainerTty") } // StartContainer ... -func (i *LibpodAPI) StartContainer(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) StartContainer(call iopodman.VarlinkCall, name string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -252,7 +252,7 @@ func (i *LibpodAPI) StartContainer(call ioprojectatomicpodman.VarlinkCall, name } // StopContainer ... -func (i *LibpodAPI) StopContainer(call ioprojectatomicpodman.VarlinkCall, name string, timeout int64) error { +func (i *LibpodAPI) StopContainer(call iopodman.VarlinkCall, name string, timeout int64) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -264,7 +264,7 @@ func (i *LibpodAPI) StopContainer(call ioprojectatomicpodman.VarlinkCall, name s } // RestartContainer ... -func (i *LibpodAPI) RestartContainer(call ioprojectatomicpodman.VarlinkCall, name string, timeout int64) error { +func (i *LibpodAPI) RestartContainer(call iopodman.VarlinkCall, name string, timeout int64) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -277,7 +277,7 @@ func (i *LibpodAPI) RestartContainer(call ioprojectatomicpodman.VarlinkCall, nam // KillContainer kills a running container. If you want to use the default SIGTERM signal, just send a -1 // for the signal arg. -func (i *LibpodAPI) KillContainer(call ioprojectatomicpodman.VarlinkCall, name string, signal int64) error { +func (i *LibpodAPI) KillContainer(call iopodman.VarlinkCall, name string, signal int64) error { killSignal := uint(syscall.SIGTERM) if signal != -1 { killSignal = uint(signal) @@ -293,17 +293,17 @@ func (i *LibpodAPI) KillContainer(call ioprojectatomicpodman.VarlinkCall, name s } // UpdateContainer ... -func (i *LibpodAPI) UpdateContainer(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) UpdateContainer(call iopodman.VarlinkCall) error { return call.ReplyMethodNotImplemented("UpdateContainer") } // RenameContainer ... -func (i *LibpodAPI) RenameContainer(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) RenameContainer(call iopodman.VarlinkCall) error { return call.ReplyMethodNotImplemented("RenameContainer") } // PauseContainer ... -func (i *LibpodAPI) PauseContainer(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) PauseContainer(call iopodman.VarlinkCall, name string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -315,7 +315,7 @@ func (i *LibpodAPI) PauseContainer(call ioprojectatomicpodman.VarlinkCall, name } // UnpauseContainer ... -func (i *LibpodAPI) UnpauseContainer(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) UnpauseContainer(call iopodman.VarlinkCall, name string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -328,12 +328,12 @@ func (i *LibpodAPI) UnpauseContainer(call ioprojectatomicpodman.VarlinkCall, nam // AttachToContainer ... // TODO: DO we also want a different one for websocket? -func (i *LibpodAPI) AttachToContainer(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) AttachToContainer(call iopodman.VarlinkCall) error { return call.ReplyMethodNotImplemented("AttachToContainer") } // WaitContainer ... -func (i *LibpodAPI) WaitContainer(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) WaitContainer(call iopodman.VarlinkCall, name string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -347,7 +347,7 @@ func (i *LibpodAPI) WaitContainer(call ioprojectatomicpodman.VarlinkCall, name s } // RemoveContainer ... -func (i *LibpodAPI) RemoveContainer(call ioprojectatomicpodman.VarlinkCall, name string, force bool) error { +func (i *LibpodAPI) RemoveContainer(call iopodman.VarlinkCall, name string, force bool) error { ctx := getContext() ctr, err := i.Runtime.LookupContainer(name) if err != nil { @@ -361,7 +361,7 @@ func (i *LibpodAPI) RemoveContainer(call ioprojectatomicpodman.VarlinkCall, name } // DeleteStoppedContainers ... -func (i *LibpodAPI) DeleteStoppedContainers(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) DeleteStoppedContainers(call iopodman.VarlinkCall) error { ctx := getContext() var deletedContainers []string containers, err := i.Runtime.GetAllContainers() @@ -384,7 +384,7 @@ func (i *LibpodAPI) DeleteStoppedContainers(call ioprojectatomicpodman.VarlinkCa } // GetAttachSockets ... -func (i *LibpodAPI) GetAttachSockets(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) GetAttachSockets(call iopodman.VarlinkCall, name string) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -403,7 +403,7 @@ func (i *LibpodAPI) GetAttachSockets(call ioprojectatomicpodman.VarlinkCall, nam } } - s := ioprojectatomicpodman.Sockets{ + s := iopodman.Sockets{ Container_id: ctr.ID(), Io_socket: ctr.AttachSocketPath(), Control_socket: ctr.ControlSocketPath(), diff --git a/pkg/varlinkapi/containers_create.go b/pkg/varlinkapi/containers_create.go index 6a601dae8..5f69a8205 100644 --- a/pkg/varlinkapi/containers_create.go +++ b/pkg/varlinkapi/containers_create.go @@ -20,7 +20,7 @@ import ( ) // CreateContainer ... -func (i *LibpodAPI) CreateContainer(call ioprojectatomicpodman.VarlinkCall, config ioprojectatomicpodman.Create) error { +func (i *LibpodAPI) CreateContainer(call iopodman.VarlinkCall, config iopodman.Create) error { rtc := i.Runtime.GetConfig() ctx := getContext() @@ -64,7 +64,7 @@ func (i *LibpodAPI) CreateContainer(call ioprojectatomicpodman.VarlinkCall, conf // varlinkCreateToCreateConfig takes the varlink input struct and maps it to a pointer // of a CreateConfig, which eventually can be used to create the OCI spec. -func varlinkCreateToCreateConfig(ctx context.Context, create ioprojectatomicpodman.Create, runtime *libpod.Runtime, imageName string, data *inspect.ImageData) (*cc.CreateConfig, error) { +func varlinkCreateToCreateConfig(ctx context.Context, create iopodman.Create, runtime *libpod.Runtime, imageName string, data *inspect.ImageData) (*cc.CreateConfig, error) { var ( inputCommand, command []string memoryLimit, memoryReservation, memorySwap, memoryKernel int64 diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go index f4ba8cbf3..f1167c6e2 100644 --- a/pkg/varlinkapi/images.go +++ b/pkg/varlinkapi/images.go @@ -26,18 +26,18 @@ import ( // ListImages lists all the images in the store // It requires no inputs. -func (i *LibpodAPI) ListImages(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) ListImages(call iopodman.VarlinkCall) error { images, err := i.Runtime.ImageRuntime().GetImages() if err != nil { return call.ReplyErrorOccurred(fmt.Sprintf("unable to get list of images %q", err)) } - var imageList []ioprojectatomicpodman.ImageInList + var imageList []iopodman.ImageInList for _, image := range images { labels, _ := image.Labels(getContext()) containers, _ := image.Containers() size, _ := image.Size(getContext()) - i := ioprojectatomicpodman.ImageInList{ + i := iopodman.ImageInList{ Id: image.ID(), ParentId: image.Parent, RepoTags: image.Names(), @@ -54,7 +54,7 @@ func (i *LibpodAPI) ListImages(call ioprojectatomicpodman.VarlinkCall) error { } // GetImage returns a single image in the form of a ImageInList -func (i *LibpodAPI) GetImage(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) GetImage(call iopodman.VarlinkCall, name string) error { newImage, err := i.Runtime.ImageRuntime().NewFromLocal(name) if err != nil { return call.ReplyErrorOccurred(err.Error()) @@ -72,7 +72,7 @@ func (i *LibpodAPI) GetImage(call ioprojectatomicpodman.VarlinkCall, name string return err } - il := ioprojectatomicpodman.ImageInList{ + il := iopodman.ImageInList{ Id: newImage.ID(), ParentId: newImage.Parent, RepoTags: newImage.Names(), @@ -87,7 +87,7 @@ func (i *LibpodAPI) GetImage(call ioprojectatomicpodman.VarlinkCall, name string } // BuildImage ... -func (i *LibpodAPI) BuildImage(call ioprojectatomicpodman.VarlinkCall, config ioprojectatomicpodman.BuildInfo) error { +func (i *LibpodAPI) BuildImage(call iopodman.VarlinkCall, config iopodman.BuildInfo) error { var ( memoryLimit int64 memorySwap int64 @@ -221,7 +221,7 @@ func (i *LibpodAPI) BuildImage(call ioprojectatomicpodman.VarlinkCall, config io time.Sleep(1 * time.Second) break } - br := ioprojectatomicpodman.BuildResponse{ + br := iopodman.BuildResponse{ Logs: log, } call.ReplyBuildImage(br) @@ -239,7 +239,7 @@ func (i *LibpodAPI) BuildImage(call ioprojectatomicpodman.VarlinkCall, config io if err != nil { return call.ReplyErrorOccurred(err.Error()) } - br := ioprojectatomicpodman.BuildResponse{ + br := iopodman.BuildResponse{ Logs: log, Id: newImage.ID(), } @@ -259,13 +259,13 @@ func build(runtime *libpod.Runtime, options imagebuildah.BuildOptions, dockerfil // CreateImage ... // TODO With Pull being added, should we skip Create? -func (i *LibpodAPI) CreateImage(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) CreateImage(call iopodman.VarlinkCall) error { return call.ReplyMethodNotImplemented("CreateImage") } // InspectImage returns an image's inspect information as a string that can be serialized. // Requires an image ID or name -func (i *LibpodAPI) InspectImage(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) InspectImage(call iopodman.VarlinkCall, name string) error { newImage, err := i.Runtime.ImageRuntime().NewFromLocal(name) if err != nil { return call.ReplyImageNotFound(name) @@ -280,7 +280,7 @@ func (i *LibpodAPI) InspectImage(call ioprojectatomicpodman.VarlinkCall, name st // HistoryImage returns the history of the image's layers // Requires an image or name -func (i *LibpodAPI) HistoryImage(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) HistoryImage(call iopodman.VarlinkCall, name string) error { newImage, err := i.Runtime.ImageRuntime().NewFromLocal(name) if err != nil { return call.ReplyImageNotFound(name) @@ -289,9 +289,9 @@ func (i *LibpodAPI) HistoryImage(call ioprojectatomicpodman.VarlinkCall, name st if err != nil { return call.ReplyErrorOccurred(err.Error()) } - var histories []ioprojectatomicpodman.ImageHistory + var histories []iopodman.ImageHistory for _, hist := range history { - imageHistory := ioprojectatomicpodman.ImageHistory{ + imageHistory := iopodman.ImageHistory{ Id: hist.ID, Created: hist.Created.String(), CreatedBy: hist.CreatedBy, @@ -306,7 +306,7 @@ func (i *LibpodAPI) HistoryImage(call ioprojectatomicpodman.VarlinkCall, name st // PushImage pushes an local image to registry // TODO We need to add options for signing, credentials, tls, and multi-tag -func (i *LibpodAPI) PushImage(call ioprojectatomicpodman.VarlinkCall, name, tag string, tlsVerify bool) error { +func (i *LibpodAPI) PushImage(call iopodman.VarlinkCall, name, tag string, tlsVerify bool) error { newImage, err := i.Runtime.ImageRuntime().NewFromLocal(name) if err != nil { return call.ReplyImageNotFound(err.Error()) @@ -329,7 +329,7 @@ func (i *LibpodAPI) PushImage(call ioprojectatomicpodman.VarlinkCall, name, tag } // TagImage accepts an image name and tag as strings and tags an image in the local store. -func (i *LibpodAPI) TagImage(call ioprojectatomicpodman.VarlinkCall, name, tag string) error { +func (i *LibpodAPI) TagImage(call iopodman.VarlinkCall, name, tag string) error { newImage, err := i.Runtime.ImageRuntime().NewFromLocal(name) if err != nil { return call.ReplyImageNotFound(name) @@ -342,7 +342,7 @@ func (i *LibpodAPI) TagImage(call ioprojectatomicpodman.VarlinkCall, name, tag s // RemoveImage accepts a image name or ID as a string and force bool to determine if it should // remove the image even if being used by stopped containers -func (i *LibpodAPI) RemoveImage(call ioprojectatomicpodman.VarlinkCall, name string, force bool) error { +func (i *LibpodAPI) RemoveImage(call iopodman.VarlinkCall, name string, force bool) error { ctx := getContext() newImage, err := i.Runtime.ImageRuntime().NewFromLocal(name) if err != nil { @@ -357,20 +357,20 @@ func (i *LibpodAPI) RemoveImage(call ioprojectatomicpodman.VarlinkCall, name str // SearchImage searches all registries configured in /etc/containers/registries.conf for an image // Requires an image name and a search limit as int -func (i *LibpodAPI) SearchImage(call ioprojectatomicpodman.VarlinkCall, name string, limit int64) error { +func (i *LibpodAPI) SearchImage(call iopodman.VarlinkCall, name string, limit int64) error { sc := image.GetSystemContext("", "", false) registries, err := sysreg.GetRegistries() if err != nil { return call.ReplyErrorOccurred(fmt.Sprintf("unable to get system registries: %q", err)) } - var imageResults []ioprojectatomicpodman.ImageSearch + var imageResults []iopodman.ImageSearch for _, reg := range registries { results, err := docker.SearchRegistry(getContext(), sc, reg, name, int(limit)) if err != nil { return call.ReplyErrorOccurred(err.Error()) } for _, result := range results { - i := ioprojectatomicpodman.ImageSearch{ + i := iopodman.ImageSearch{ Description: result.Description, Is_official: result.IsOfficial, Is_automated: result.IsAutomated, @@ -385,7 +385,7 @@ func (i *LibpodAPI) SearchImage(call ioprojectatomicpodman.VarlinkCall, name str // DeleteUnusedImages deletes any images that do not have containers associated with it. // TODO Filters are not implemented -func (i *LibpodAPI) DeleteUnusedImages(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) DeleteUnusedImages(call iopodman.VarlinkCall) error { images, err := i.Runtime.ImageRuntime().GetImages() if err != nil { return call.ReplyErrorOccurred(err.Error()) @@ -407,7 +407,7 @@ func (i *LibpodAPI) DeleteUnusedImages(call ioprojectatomicpodman.VarlinkCall) e } // Commit ... -func (i *LibpodAPI) Commit(call ioprojectatomicpodman.VarlinkCall, name, imageName string, changes []string, author, message string, pause bool) error { +func (i *LibpodAPI) Commit(call iopodman.VarlinkCall, name, imageName string, changes []string, author, message string, pause bool) error { ctr, err := i.Runtime.LookupContainer(name) if err != nil { return call.ReplyContainerNotFound(name) @@ -435,7 +435,7 @@ func (i *LibpodAPI) Commit(call ioprojectatomicpodman.VarlinkCall, name, imageNa } // ImportImage imports an image from a tarball to the image store -func (i *LibpodAPI) ImportImage(call ioprojectatomicpodman.VarlinkCall, source, reference, message string, changes []string) error { +func (i *LibpodAPI) ImportImage(call iopodman.VarlinkCall, source, reference, message string, changes []string) error { configChanges, err := util.GetImageConfig(changes) if err != nil { return call.ReplyErrorOccurred(err.Error()) @@ -456,7 +456,7 @@ func (i *LibpodAPI) ImportImage(call ioprojectatomicpodman.VarlinkCall, source, // ExportImage exports an image to the provided destination // destination must have the transport type!! -func (i *LibpodAPI) ExportImage(call ioprojectatomicpodman.VarlinkCall, name, destination string, compress bool, tags []string) error { +func (i *LibpodAPI) ExportImage(call iopodman.VarlinkCall, name, destination string, compress bool, tags []string) error { newImage, err := i.Runtime.ImageRuntime().NewFromLocal(name) if err != nil { return call.ReplyImageNotFound(name) @@ -475,7 +475,7 @@ func (i *LibpodAPI) ExportImage(call ioprojectatomicpodman.VarlinkCall, name, de // PullImage pulls an image from a registry to the image store. // TODO This implementation is incomplete -func (i *LibpodAPI) PullImage(call ioprojectatomicpodman.VarlinkCall, name string) error { +func (i *LibpodAPI) PullImage(call iopodman.VarlinkCall, name string) error { newImage, err := i.Runtime.ImageRuntime().New(getContext(), name, "", "", nil, &image.DockerRegistryOptions{}, image.SigningOptions{}, true, false) if err != nil { return call.ReplyErrorOccurred(fmt.Sprintf("unable to pull %s: %s", name, err.Error())) diff --git a/pkg/varlinkapi/system.go b/pkg/varlinkapi/system.go index 747a25966..042aef942 100644 --- a/pkg/varlinkapi/system.go +++ b/pkg/varlinkapi/system.go @@ -9,13 +9,13 @@ import ( ) // GetVersion ... -func (i *LibpodAPI) GetVersion(call ioprojectatomicpodman.VarlinkCall) error { +func (i *LibpodAPI) GetVersion(call iopodman.VarlinkCall) error { versionInfo, err := libpod.GetVersion() if err != nil { return err } - return call.ReplyGetVersion(ioprojectatomicpodman.Version{ + return call.ReplyGetVersion(iopodman.Version{ Version: versionInfo.Version, Go_version: versionInfo.GoVersion, Git_commit: versionInfo.GitCommit, @@ -26,21 +26,21 @@ func (i *LibpodAPI) GetVersion(call ioprojectatomicpodman.VarlinkCall) error { // Ping returns a simple string "OK" response for clients to make sure // the service is working. -func (i *LibpodAPI) Ping(call ioprojectatomicpodman.VarlinkCall) error { - return call.ReplyPing(ioprojectatomicpodman.StringResponse{ +func (i *LibpodAPI) Ping(call iopodman.VarlinkCall) error { + return call.ReplyPing(iopodman.StringResponse{ Message: "OK", }) } // GetInfo returns details about the podman host and its stores -func (i *LibpodAPI) GetInfo(call ioprojectatomicpodman.VarlinkCall) error { - podmanInfo := ioprojectatomicpodman.PodmanInfo{} +func (i *LibpodAPI) GetInfo(call iopodman.VarlinkCall) error { + podmanInfo := iopodman.PodmanInfo{} info, err := i.Runtime.Info() if err != nil { return call.ReplyErrorOccurred(err.Error()) } host := info[0].Data - infoHost := ioprojectatomicpodman.InfoHost{ + infoHost := iopodman.InfoHost{ Mem_free: host["MemFree"].(int64), Mem_total: host["MemTotal"].(int64), Swap_free: host["SwapFree"].(int64), @@ -53,7 +53,7 @@ func (i *LibpodAPI) GetInfo(call ioprojectatomicpodman.VarlinkCall) error { } podmanInfo.Host = infoHost store := info[1].Data - pmaninfo := ioprojectatomicpodman.InfoPodmanBinary{ + pmaninfo := iopodman.InfoPodmanBinary{ Compiler: goruntime.Compiler, Go_version: goruntime.Version(), // TODO : How are we going to get this here? @@ -61,12 +61,12 @@ func (i *LibpodAPI) GetInfo(call ioprojectatomicpodman.VarlinkCall) error { Git_commit: libpod.GitCommit, } - graphStatus := ioprojectatomicpodman.InfoGraphStatus{ + graphStatus := iopodman.InfoGraphStatus{ Backing_filesystem: store["GraphStatus"].(map[string]string)["Backing Filesystem"], Native_overlay_diff: store["GraphStatus"].(map[string]string)["Native Overlay Diff"], Supports_d_type: store["GraphStatus"].(map[string]string)["Supports d_type"], } - infoStore := ioprojectatomicpodman.InfoStore{ + infoStore := iopodman.InfoStore{ Graph_driver_name: store["GraphDriverName"].(string), Containers: int64(store["ContainerStore"].(map[string]interface{})["number"].(int)), Images: int64(store["ImageStore"].(map[string]interface{})["number"].(int)), diff --git a/pkg/varlinkapi/util.go b/pkg/varlinkapi/util.go index ad5c8c19d..667c09562 100644 --- a/pkg/varlinkapi/util.go +++ b/pkg/varlinkapi/util.go @@ -15,15 +15,15 @@ func getContext() context.Context { return context.TODO() } -func makeListContainer(containerID string, batchInfo batchcontainer.BatchContainerStruct) ioprojectatomicpodman.ListContainerData { +func makeListContainer(containerID string, batchInfo batchcontainer.BatchContainerStruct) iopodman.ListContainerData { var ( - mounts []ioprojectatomicpodman.ContainerMount - ports []ioprojectatomicpodman.ContainerPortMappings + mounts []iopodman.ContainerMount + ports []iopodman.ContainerPortMappings ) ns := batchcontainer.GetNamespaces(batchInfo.Pid) for _, mount := range batchInfo.ConConfig.Spec.Mounts { - m := ioprojectatomicpodman.ContainerMount{ + m := iopodman.ContainerMount{ Destination: mount.Destination, Type: mount.Type, Source: mount.Source, @@ -33,7 +33,7 @@ func makeListContainer(containerID string, batchInfo batchcontainer.BatchContain } for _, pm := range batchInfo.ConConfig.PortMappings { - p := ioprojectatomicpodman.ContainerPortMappings{ + p := iopodman.ContainerPortMappings{ Host_port: strconv.Itoa(int(pm.HostPort)), Host_ip: pm.HostIP, Protocol: pm.Protocol, @@ -45,7 +45,7 @@ func makeListContainer(containerID string, batchInfo batchcontainer.BatchContain // If we find this needs to be done for other container endpoints, we should // convert this to a separate function or a generic map from struct function. - namespace := ioprojectatomicpodman.ContainerNameSpace{ + namespace := iopodman.ContainerNameSpace{ User: ns.User, Uts: ns.UTS, Pidns: ns.PIDNS, @@ -56,7 +56,7 @@ func makeListContainer(containerID string, batchInfo batchcontainer.BatchContain Ipc: ns.IPC, } - lc := ioprojectatomicpodman.ListContainerData{ + lc := iopodman.ListContainerData{ Id: containerID, Image: batchInfo.ConConfig.RootfsImageName, Imageid: batchInfo.ConConfig.RootfsImageID, |