Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support ipv6 in connection #862

Closed
wants to merge 1 commit into from
Closed

fix: support ipv6 in connection #862

wants to merge 1 commit into from

Conversation

yanksyoon
Copy link
Contributor

@yanksyoon yanksyoon commented May 29, 2023

Description

Current connection only supports ipv4 addresses, which throws a ValueError when ipv6 address is passed (int(port)).

Traceback (most recent call last):
  File "/home/yanks/Documents/canonical/jenkins-k8s-operator/.tox/integration/lib/python3.10/site-packages/pytest_asyncio/plugin.py", line 320, in _async_fixture_wrapper
    return event_loop.run_until_complete(setup())
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/yanks/Documents/canonical/jenkins-k8s-operator/.tox/integration/lib/python3.10/site-packages/pytest_asyncio/plugin.py", line 317, in setup
    res = await func(**_add_kwargs(func, kwargs, event_loop, request))
  File "/home/yanks/Documents/canonical/jenkins-k8s-operator/tests/integration/conftest.py", line 159, in jenkins_machine_agent_fixture
    agent_app = await machine_model.deploy("jenkins-agent")
  File "/home/yanks/Documents/canonical/jenkins-k8s-operator/.tox/integration/lib/python3.10/site-packages/juju/model.py", line 1787, in deploy
    is_sub = await self.charmhub.is_subordinate(url.name)
  File "/home/yanks/Documents/canonical/jenkins-k8s-operator/.tox/integration/lib/python3.10/site-packages/juju/charmhub.py", line 35, in is_subordinate
    conn, headers, path_prefix = self.model.connection().https_connection()
  File "/home/yanks/Documents/canonical/jenkins-k8s-operator/.tox/integration/lib/python3.10/site-packages/juju/client/connection.py", line 699, in https_connection
    host, int(port),
ValueError: invalid literal for int() with base 10: '7b4b:909c:3c9a:216:3eff:fe98:cf21]:17070'

This change adds support for ipv6 addresses.

QA Steps

tox -e py3 -- tests/unit/...
tox -e integration -- tests/integration/...

All CI tests need to pass.

<Please note that most likely an additional test will be required by the reviewers for any change that's not a one liner to land.>

Notes & Discussion

<Additional notes for the reviewers if needed. Please delete section if not applicable.>

@jujubot
Copy link
Contributor

jujubot commented May 29, 2023

Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch.

@hpidcock @anvial @juanmanuel-tirado

1 similar comment
@jujubot
Copy link
Contributor

jujubot commented May 29, 2023

Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch.

@hpidcock @anvial @juanmanuel-tirado

@yanksyoon yanksyoon changed the title fix: support ipv6 fix: support ipv6 in connection May 29, 2023
@cderici
Copy link
Contributor

cderici commented May 30, 2023

@yanksyoon Thanks for the PR! We do have another PR against the 2.9 branch for this that should've been forward ported already, I'll cherry pick from that one for consistency and future reference, so I'll close this one, thanks again 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants