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

Documentation: Open a Kubernetes port in your charm #3535

Open
mathmarchand opened this issue Nov 5, 2024 · 0 comments
Open

Documentation: Open a Kubernetes port in your charm #3535

mathmarchand opened this issue Nov 5, 2024 · 0 comments

Comments

@mathmarchand
Copy link

mathmarchand commented Nov 5, 2024

Docs page: https://juju.is/docs/sdk/open-a-kubernetes-port-in-your-charm

Docs source: https://discourse.charmhub.io/t/open-a-kubernetes-port-in-your-charm/12244

Issue:
In the scenario test, there are a few errors if ran on the current version of charm-dev mulitpass VM.

state1 = ctx.run('config_changed', state_in)

Would throw an TypeError, it should be:

state1 = ctx.run(ctx.on.config_changed(), state_in)

Then those asserts:

    assert state1.opened_ports[0].port == 8000
    assert state1.opened_ports[0].protocol == 'tcp'

Would fails because opened_ports is a frozenset. We can do this instead:

    assert list(state1.opened_ports)[0].port == 8000
    assert list(state1.opened_ports)[0].protocol == 'tcp'

Regards,
Math Marchand

Note: if needed my discourse handle is @mathmarchand

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

No branches or pull requests

1 participant