Skip to content

Commit

Permalink
Merge pull request containers#23552 from cevich/cleanup_python_cni
Browse files Browse the repository at this point in the history
Drop APIv2 CNI configuration
  • Loading branch information
openshift-merge-bot[bot] authored Aug 9, 2024
2 parents dd1d2c1 + a48cd24 commit 48e727f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 72 deletions.
36 changes: 0 additions & 36 deletions test/apiv2/python/rest_api/fixtures/podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,6 @@ def __init__(self):
with open(os.environ["CONTAINERS_REGISTRIES_CONF"], "w") as w:
p.write(w)

os.environ["CNI_CONFIG_PATH"] = os.path.join(self.anchor_directory, "cni", "net.d")
os.makedirs(os.environ["CNI_CONFIG_PATH"], exist_ok=True)
self.cmd.append("--network-config-dir=" + os.environ["CNI_CONFIG_PATH"])
cni_cfg = os.path.join(os.environ["CNI_CONFIG_PATH"], "87-podman-bridge.conflist")
# json decoded and encoded to ensure legal json
buf = json.loads(
"""
{
"cniVersion": "0.3.0",
"name": "podman",
"plugins": [{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"ipam": {
"type": "host-local",
"subnet": "10.88.0.0/16",
"routes": [{
"dst": "0.0.0.0/0"
}]
}
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
}
}
]
}
"""
)
with open(cni_cfg, "w") as w:
json.dump(buf, w)

def open(self, command, *args, **kwargs):
"""Podman initialized instance to run a given command
Expand Down
36 changes: 0 additions & 36 deletions test/python/docker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,42 +68,6 @@ def __init__(self):
with open(os.environ["CONTAINERS_REGISTRIES_CONF"], "w") as file:
file.write(conf)

os.environ["CNI_CONFIG_PATH"] = os.path.join(self.anchor_directory, "cni", "net.d")
os.makedirs(os.environ["CNI_CONFIG_PATH"], exist_ok=True)
self.cmd.append("--network-config-dir=" + os.environ["CNI_CONFIG_PATH"])
cni_cfg = os.path.join(os.environ["CNI_CONFIG_PATH"], "87-podman-bridge.conflist")
# json decoded and encoded to ensure legal json
buf = json.loads(
"""
{
"cniVersion": "0.3.0",
"name": "default",
"plugins": [{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"ipam": {
"type": "host-local",
"subnet": "10.88.0.0/16",
"routes": [{
"dst": "0.0.0.0/0"
}]
}
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
}
}
]
}
"""
)
with open(cni_cfg, "w") as file:
json.dump(buf, file)

def open(self, command, *args, **kwargs):
"""Podman initialized instance to run a given command
Expand Down

0 comments on commit 48e727f

Please sign in to comment.