Skip to content

Commit ef01145

Browse files
renovate[bot]arturo-seijasweiiwang01
authored
chore(deps): update dependency ops to v2.18.0 (#250)
--------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Arturo Seijas <[email protected]> Co-authored-by: Weii Wang <[email protected]>
1 parent 7b93a33 commit ef01145

File tree

7 files changed

+19
-44
lines changed

7 files changed

+19
-44
lines changed

.github/workflows/integration_test.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ jobs:
2323
./tests/integration/pre_run_script.sh"
2424
setup-devstack-swift: true
2525
trivy-image-config: ./trivy.yaml
26+
channel: 1.31/stable

.licenserc.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ header:
55
content: |
66
Copyright [year] [owner]
77
See LICENSE file for licensing details.
8+
pattern: |
9+
Copyright \d{4} Canonical Ltd.
10+
See LICENSE file for licensing details.
811
paths:
912
- '**'
1013
paths-ignore:

.trivyignore

+4
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ CVE-2023-45287
1515
CVE-2023-45288
1616
CVE-2024-24790
1717
CVE-2024-34156
18+
# golang
19+
CVE-2024-45337
20+
CVE-2024-45338
21+

charmcraft.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ parts:
1717
- requests
1818
- ops-lib-mysql
1919
charm-binary-python-packages:
20-
- mysql-connector-python
20+
- mysql-connector-python==9.1.0

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
mysql-connector-python
2-
ops==2.17.1
2+
ops==2.18.0
33
requests==2.32.3
44
pydantic>=1,<2

tests/integration/conftest.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ async def prepare_swift(wordpress: WordpressApp, swift_config: Dict[str, str]):
205205
@pytest_asyncio.fixture(scope="module")
206206
async def prepare_nginx_ingress(wordpress: WordpressApp, prepare_mysql):
207207
"""Deploy and relate nginx-ingress-integrator charm for integration tests."""
208-
await wordpress.model.deploy("nginx-ingress-integrator", series="focal", trust=True)
208+
await wordpress.model.deploy(
209+
"nginx-ingress-integrator", channel="latest/edge", series="focal", revision=133, trust=True
210+
)
209211
await wordpress.model.wait_for_idle(apps=["nginx-ingress-integrator"], timeout=30 * 60)
210212
await wordpress.model.relate(f"{wordpress.name}:nginx-route", "nginx-ingress-integrator")
211213
await wordpress.model.wait_for_idle(status="active")

tests/integration/test_ingress.py

+6-41
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
"""Integration tests for WordPress charm ingress integration."""
55

6-
import socket
7-
import unittest.mock
8-
96
import kubernetes
107
import pytest
118
import requests
@@ -21,37 +18,6 @@ async def test_ingress(wordpress: WordpressApp):
2118
and WordPress charm.
2219
assert: A Kubernetes ingress should be created and the ingress should accept HTTPS connections.
2320
"""
24-
25-
def gen_patch_getaddrinfo(host: str, resolve_to: str):
26-
"""Generate patched getaddrinfo function.
27-
28-
This function is used to generate a patched getaddrinfo function that will resolve to the
29-
resolve_to address without having to actually register a host.
30-
31-
Args:
32-
host: intended hostname of a given application.
33-
resolve_to: destination address for host to resolve to.
34-
35-
Returns:
36-
A patching function for getaddrinfo.
37-
"""
38-
original_getaddrinfo = socket.getaddrinfo
39-
40-
def patched_getaddrinfo(*args):
41-
"""Patch getaddrinfo to point to desired ip address.
42-
43-
Args:
44-
args: original arguments to getaddrinfo when creating network connection.
45-
46-
Returns:
47-
Patched getaddrinfo function.
48-
"""
49-
if args[0] == host:
50-
return original_getaddrinfo(resolve_to, *args[1:])
51-
return original_getaddrinfo(*args)
52-
53-
return patched_getaddrinfo
54-
5521
response = requests.get("http://127.0.0.1", headers={"Host": wordpress.name}, timeout=5)
5622
assert (
5723
response.status_code == 200 and "wordpress" in response.text.lower()
@@ -60,13 +26,12 @@ def patched_getaddrinfo(*args):
6026
new_hostname = "wordpress.test"
6127
await wordpress.set_config({"blog_hostname": new_hostname})
6228
await wordpress.model.wait_for_idle(status="active")
63-
with unittest.mock.patch.multiple(
64-
socket, getaddrinfo=gen_patch_getaddrinfo(new_hostname, "127.0.0.1")
65-
):
66-
response = requests.get(f"https://{new_hostname}", timeout=5, verify=False) # nosec
67-
assert (
68-
response.status_code == 200 and "wordpress" in response.text.lower()
69-
), "Ingress should update the server name indication based routing after blog_hostname updated"
29+
response = requests.get(
30+
"https://127.0.0.1", headers={"Host": new_hostname}, timeout=5, verify=False
31+
) # nosec
32+
assert (
33+
response.status_code == 200 and "wordpress" in response.text.lower()
34+
), "Ingress should update the server name indication based routing after blog_hostname updated"
7035

7136

7237
@pytest.mark.usefixtures("prepare_mysql", "prepare_nginx_ingress", "prepare_swift")

0 commit comments

Comments
 (0)