Skip to content

Documentation: Open a Kubernetes port in your charm #18879

Closed
@mathmarchand

Description

@mathmarchand

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

Metadata

Metadata

Assignees

Labels

kind/docindicates a documentation changetriagedissue has been triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions