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

ephemeral statuses lost #329

Open
PietroPasotti opened this issue Apr 23, 2024 · 0 comments
Open

ephemeral statuses lost #329

PietroPasotti opened this issue Apr 23, 2024 · 0 comments

Comments

@PietroPasotti
Copy link
Collaborator

PietroPasotti commented Apr 23, 2024

Bug Description

at the moment status management in traefik is decentralized and little is done to prevent statuses from being overridden even within the same event.

To Reproduce

suppose the charm is in blocked because some relation sent bad data:

    charm.traefik_route.on.ready.emit(charm.model.get_relation("traefik-route"))
    with pytest.raises(StaticConfigMergeConflictError):
        charm.traefik.generate_static_config(_raise=True)

    # THEN the charm status is blocked
    assert isinstance(charm.unit.status, ops.BlockedStatus)

as soon as we receive another, unrelated event, the blocked status is lost.

    charm.on.update_status.emit()
    assert isinstance(charm.unit.status, ops.ActiveStatus)

Environment

n/a

Relevant log output

n/a

Additional context

Solution:
adopt collect-unit-status common exit hook pattern, and some sort of compound-status to store error statuses across hook contexts

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

No branches or pull requests

1 participant