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

Docs for refresh_events is incorrect #77

Open
samuelallan72 opened this issue Mar 20, 2024 · 1 comment
Open

Docs for refresh_events is incorrect #77

samuelallan72 opened this issue Mar 20, 2024 · 1 comment

Comments

@samuelallan72
Copy link
Contributor

samuelallan72 commented Mar 20, 2024

Bug Description

Docs for refresh_events optional kwarg to COSAgentProvider shows that string event names are accepted:

refresh_events=["update-status", "upgrade-charm"],

(https://github.com/canonical/grafana-agent-operator/blob/main/lib/charms/grafana_agent/v0/cos_agent.py#L110)

However this crashes with this error:

RuntimeError: Framework.observe requires a BoundEvent as second parameter, got config-changed

The docs (text, examples, and type hints) should be updated to demonstrate that it takes event classes as values here.

@samuelallan72
Copy link
Contributor Author

It should also be documented that refresh_events defaults to the charm on.config_changed event - it's not clear because this is set in the init method, not from the default value of the kwarg (None).

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