mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00
Add IndexConfigs to compat /info endpoint
Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
@ -42,16 +42,19 @@ class Podman(object):
|
||||
os.environ["CONTAINERS_REGISTRIES_CONF"] = os.path.join(
|
||||
self.anchor_directory, "registry.conf"
|
||||
)
|
||||
p = configparser.ConfigParser()
|
||||
p.read_dict(
|
||||
{
|
||||
"registries.search": {"registries": "['quay.io', 'docker.io']"},
|
||||
"registries.insecure": {"registries": "[]"},
|
||||
"registries.block": {"registries": "[]"},
|
||||
}
|
||||
)
|
||||
conf = """unqualified-search-registries = ["docker.io", "quay.io"]
|
||||
|
||||
[[registry]]
|
||||
location="localhost:5000"
|
||||
insecure=true
|
||||
|
||||
[[registry.mirror]]
|
||||
location = "mirror.localhost:5000"
|
||||
|
||||
"""
|
||||
|
||||
with open(os.environ["CONTAINERS_REGISTRIES_CONF"], "w") as w:
|
||||
p.write(w)
|
||||
w.write(conf)
|
||||
|
||||
os.environ["CNI_CONFIG_PATH"] = os.path.join(
|
||||
self.anchor_directory, "cni", "net.d"
|
||||
|
@ -54,7 +54,10 @@ class TestSystem(unittest.TestCase):
|
||||
return super().tearDownClass()
|
||||
|
||||
def test_Info(self):
|
||||
self.assertIsNotNone(self.client.info())
|
||||
info = self.client.info()
|
||||
self.assertIsNotNone(info)
|
||||
self.assertEqual(info["RegistryConfig"]["IndexConfigs"]["localhost:5000"]["Secure"], False)
|
||||
self.assertEqual(info["RegistryConfig"]["IndexConfigs"]["localhost:5000"]["Mirrors"], ["mirror.localhost:5000"])
|
||||
|
||||
def test_info_container_details(self):
|
||||
info = self.client.info()
|
||||
|
Reference in New Issue
Block a user