Compare commits

...

8 Commits
main ... v4.8.1

Author SHA1 Message Date
Urvashi Mohnani e524db436a
Merge pull request #357 from umohnani8/4.8.1
Bump version to podman 4.8.1
2023-12-21 07:35:41 -05:00
Urvashi Mohnani 29603f2cd1 Bump version to podman 4.8.1
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-12-20 11:30:08 -05:00
openshift-merge-bot[bot] ae0f1ee8ca
Merge pull request #359 from openshift-cherrypick-robot/cherry-pick-358-to-release-4.8
[release-4.8] Fix lint issues
2023-12-20 14:07:15 +00:00
Urvashi Mohnani e767cd8f7d Fix lint issues
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-12-20 13:26:15 +00:00
openshift-merge-bot[bot] 40d7bb319f
Merge pull request #354 from openshift-cherrypick-robot/cherry-pick-353-to-release-4.8
[release-4.8] Add rich dep to setup.cfg
2023-12-20 08:34:33 +00:00
Urvashi Mohnani 3a63473dcc Add rich dep to setup.cfg
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-12-11 12:55:21 +00:00
openshift-merge-bot[bot] 803ea74b3b
Merge pull request #347 from umohnani8/4.8.0-1
Bump version to 4.8.0.post1
2023-11-29 13:05:43 +00:00
Urvashi Mohnani 1555080e7f Bump version to 4.8.0.post1
Had an issue with the 4.8.0 release on pypi and we can't
repush changes with the same version again so need to bump
to a minor version to be able to publish on pypi again.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-11-29 07:41:41 -05:00
12 changed files with 121 additions and 151 deletions

View File

@ -8,7 +8,7 @@ DESTDIR ?=
EPOCH_TEST_COMMIT ?= $(shell git merge-base $${DEST_BRANCH:-main} HEAD)
HEAD ?= HEAD
export PODMAN_VERSION ?= "4.8.0"
export PODMAN_VERSION ?= "4.8.1"
.PHONY: podman
podman:

View File

@ -383,22 +383,20 @@ class CreateMixin: # pylint: disable=too-few-public-methods
del args[key]
# These keywords are not supported for various reasons.
unsupported_keys = set(args.keys()).intersection(
(
"blkio_weight",
"blkio_weight_device", # FIXME In addition to device Major/Minor include path
"device_cgroup_rules", # FIXME Where to map for Podman API?
"device_read_bps", # FIXME In addition to device Major/Minor include path
"device_read_iops", # FIXME In addition to device Major/Minor include path
"device_requests", # FIXME In addition to device Major/Minor include path
"device_write_bps", # FIXME In addition to device Major/Minor include path
"device_write_iops", # FIXME In addition to device Major/Minor include path
"domainname",
"network_disabled", # FIXME Where to map for Podman API?
"storage_opt", # FIXME Where to map for Podman API?
"tmpfs", # FIXME Where to map for Podman API?
)
)
unsupported_keys = set(args.keys()).intersection((
"blkio_weight",
"blkio_weight_device", # FIXME In addition to device Major/Minor include path
"device_cgroup_rules", # FIXME Where to map for Podman API?
"device_read_bps", # FIXME In addition to device Major/Minor include path
"device_read_iops", # FIXME In addition to device Major/Minor include path
"device_requests", # FIXME In addition to device Major/Minor include path
"device_write_bps", # FIXME In addition to device Major/Minor include path
"device_write_iops", # FIXME In addition to device Major/Minor include path
"domainname",
"network_disabled", # FIXME Where to map for Podman API?
"storage_opt", # FIXME Where to map for Podman API?
"tmpfs", # FIXME Where to map for Podman API?
))
if len(unsupported_keys) > 0:
raise TypeError(
f"""Keyword(s) '{" ,".join(unsupported_keys)}' are"""

View File

@ -3,5 +3,5 @@
# Do not auto-update these from version.py,
# as test code should be changed to reflect changes in Podman API versions
BASE_SOCK = "unix:///run/api.sock"
LIBPOD_URL = "http://%2Frun%2Fapi.sock/v4.8.0/libpod"
LIBPOD_URL = "http://%2Frun%2Fapi.sock/v4.8.1/libpod"
COMPATIBLE_URL = "http://%2Frun%2Fapi.sock/v1.40"

View File

@ -106,20 +106,14 @@ class ContainersTestCase(unittest.TestCase):
@requests_mock.Mocker()
def test_stats(self, mock):
stream = [
{
"Error": None,
"Stats": [
{
"ContainerId": (
"87e1325c82424e49a00abdd4de08009eb76c7de8d228426a9b8af9318ced5ecd"
),
"Name": "evil_ptolemy",
"CPU": 1000.0,
}
],
}
]
stream = [{
"Error": None,
"Stats": [{
"ContainerId": "87e1325c82424e49a00abdd4de08009eb76c7de8d228426a9b8af9318ced5ecd",
"Name": "evil_ptolemy",
"CPU": 1000.0,
}],
}]
buffer = io.StringIO()
for entry in stream:
buffer.write(json.JSONEncoder().encode(entry))
@ -413,28 +407,23 @@ class ContainersTestCase(unittest.TestCase):
@requests_mock.Mocker()
def test_top_with_streaming(self, mock):
stream = [
{
"Processes": [
[
'jhonce',
'2417',
'2274',
'0',
'Mar01',
'?',
'00:00:01',
(
'/usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash -c'
' "/usr/bin/gnome-session"'
),
],
['jhonce', '5544', '3522', '0', 'Mar01', 'pts/1', '00:00:02', '-bash'],
['jhonce', '6140', '3522', '0', 'Mar01', 'pts/2', '00:00:00', '-bash'],
stream = [{
"Processes": [
[
'jhonce',
'2417',
'2274',
'0',
'Mar01',
'?',
'00:00:01',
'/usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash -c "/usr/bin/gnome-session"',
],
"Titles": ["UID", "PID", "PPID", "C", "STIME", "TTY", "TIME CMD"],
}
]
['jhonce', '5544', '3522', '0', 'Mar01', 'pts/1', '00:00:02', '-bash'],
['jhonce', '6140', '3522', '0', 'Mar01', 'pts/2', '00:00:00', '-bash'],
],
"Titles": ["UID", "PID", "PPID", "C", "STIME", "TTY", "TIME CMD"],
}]
buffer = io.StringIO()
for entry in stream:

View File

@ -22,23 +22,21 @@ class EventsManagerTestCase(unittest.TestCase):
@requests_mock.Mocker()
def test_list(self, mock):
stream = [
{
"Type": "pod",
"Action": "create",
"Actor": {
"ID": "",
"Attributes": {
"image": "",
"name": "",
"containerExitCode": 0,
},
stream = [{
"Type": "pod",
"Action": "create",
"Actor": {
"ID": "",
"Attributes": {
"image": "",
"name": "",
"containerExitCode": 0,
},
"Scope": "local",
"Time": 1615845480,
"TimeNano": 1615845480,
}
]
},
"Scope": "local",
"Time": 1615845480,
"TimeNano": 1615845480,
}]
buffer = io.StringIO()
for item in stream:
buffer.write(json.JSONEncoder().encode(item))

View File

@ -51,16 +51,14 @@ class ImageTestCase(unittest.TestCase):
adapter = mock.get(
tests.LIBPOD_URL
+ "/images/326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab/history",
json=[
{
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
"Comment": "",
"Created": 1614208404,
"CreatedBy": "2021-02-24T23:13:24+00:00",
"Tags": ["latest"],
"Size": 1024,
}
],
json=[{
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
"Comment": "",
"Created": 1614208404,
"CreatedBy": "2021-02-24T23:13:24+00:00",
"Tags": ["latest"],
"Size": 1024,
}],
)
image = Image(attrs=FIRST_IMAGE, client=self.client.api)

View File

@ -156,13 +156,11 @@ class ImagesManagerTestCase(unittest.TestCase):
"""Unit test Images prune()."""
mock.post(
tests.LIBPOD_URL + "/images/prune",
json=[
{
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
"Err": None,
"Size": 1024,
}
],
json=[{
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
"Err": None,
"Size": 1024,
}],
)
results = self.client.images.prune()
@ -212,11 +210,9 @@ class ImagesManagerTestCase(unittest.TestCase):
"""Unit test to report error carried in response body."""
mock.post(
tests.LIBPOD_URL + "/images/prune",
json=[
{
"Err": "Test prune failure in response body.",
}
],
json=[{
"Err": "Test prune failure in response body.",
}],
)
with self.assertRaises(APIError) as e:

View File

@ -34,16 +34,14 @@ FIRST_NETWORK_LIBPOD = {
"driver": "bridge",
"network_interface": "libpod_veth0",
"created": "2022-01-28T09:18:37.491308364-07:00",
"subnets": [
{
"subnet": "10.11.12.0/24",
"gateway": "10.11.12.1",
"lease_range": {
"start_ip": "10.11.12.1",
"end_ip": "10.11.12.63",
},
}
],
"subnets": [{
"subnet": "10.11.12.0/24",
"gateway": "10.11.12.1",
"lease_range": {
"start_ip": "10.11.12.1",
"end_ip": "10.11.12.63",
},
}],
"ipv6_enabled": False,
"internal": False,
"dns_enabled": False,

View File

@ -56,16 +56,14 @@ FIRST_NETWORK_LIBPOD = {
"driver": "bridge",
"network_interface": "libpod_veth0",
"created": "2022-01-28T09:18:37.491308364-07:00",
"subnets": [
{
"subnet": "10.11.12.0/24",
"gateway": "10.11.12.1",
"lease_range": {
"start_ip": "10.11.12.1",
"end_ip": "10.11.12.63",
},
}
],
"subnets": [{
"subnet": "10.11.12.0/24",
"gateway": "10.11.12.1",
"lease_range": {
"start_ip": "10.11.12.1",
"end_ip": "10.11.12.63",
},
}],
"ipv6_enabled": False,
"internal": False,
"dns_enabled": False,
@ -80,16 +78,14 @@ SECOND_NETWORK_LIBPOD = {
"created": "2021-03-01T09:18:37.491308364-07:00",
"driver": "bridge",
"network_interface": "libpod_veth1",
"subnets": [
{
"subnet": "10.11.12.0/24",
"gateway": "10.11.12.1",
"lease_range": {
"start_ip": "10.11.12.1",
"end_ip": "10.11.12.63",
},
}
],
"subnets": [{
"subnet": "10.11.12.0/24",
"gateway": "10.11.12.1",
"lease_range": {
"start_ip": "10.11.12.1",
"end_ip": "10.11.12.63",
},
}],
"ipv6_enabled": False,
"internal": False,
"dns_enabled": False,

View File

@ -194,34 +194,30 @@ class PodsManagerTestCase(unittest.TestCase):
@requests_mock.Mocker()
def test_top_with_streaming(self, mock):
stream = [
[
{
'CPU': '2.53%',
'MemUsage': '49.15kB / 16.71GB',
'MemUsageBytes': '48KiB / 15.57GiB',
'Mem': '0.00%',
'NetIO': '7.638kB / 430B',
'BlockIO': '-- / --',
'PIDS': '1',
'Pod': '1c948ab42339',
'CID': 'd999c49a7b6c',
'Name': '1c948ab42339-infra',
}
],
[
{
'CPU': '1.46%',
'MemUsage': '57.23B / 16.71GB',
'MemUsageBytes': '48KiB / 15.57GiB',
'Mem': '0.00%',
'NetIO': '7.638kB / 430B',
'BlockIO': '-- / --',
'PIDS': '1',
'Pod': '1c948ab42339',
'CID': 'd999c49a7b6c',
'Name': '1c948ab42339-infra',
}
],
[{
'CPU': '2.53%',
'MemUsage': '49.15kB / 16.71GB',
'MemUsageBytes': '48KiB / 15.57GiB',
'Mem': '0.00%',
'NetIO': '7.638kB / 430B',
'BlockIO': '-- / --',
'PIDS': '1',
'Pod': '1c948ab42339',
'CID': 'd999c49a7b6c',
'Name': '1c948ab42339-infra',
}],
[{
'CPU': '1.46%',
'MemUsage': '57.23B / 16.71GB',
'MemUsageBytes': '48KiB / 15.57GiB',
'Mem': '0.00%',
'NetIO': '7.638kB / 430B',
'BlockIO': '-- / --',
'PIDS': '1',
'Pod': '1c948ab42339',
'CID': 'd999c49a7b6c',
'Name': '1c948ab42339-infra',
}],
]
buffer = io.StringIO()

View File

@ -1,4 +1,4 @@
"""Version of PodmanPy."""
__version__ = "4.8.0"
__version__ = "4.8.1"
__compatible_version__ = "1.40"

View File

@ -1,6 +1,6 @@
[metadata]
name = podman
version = 4.8.0
version = 4.8.1
author = Brent Baude, Jhon Honce
author_email = jhonce@redhat.com
description = Bindings for Podman RESTful API
@ -38,6 +38,7 @@ install_requires =
requests >=2.24
tomli>=1.2.3; python_version<'3.11'
urllib3
rich >= 12.5.1
# typing_extensions are included for RHEL 8.5
# typing_extensions;python_version<'3.8'