canonical / grafana-agent-operator

https://charmhub.io/grafana-agent
Apache License 2.0
4 stars 11 forks source link

Fix pydantic imports after pin to pydantic.v1 #166

Closed mmkay closed 3 months ago

mmkay commented 3 months ago

Issue

After #156, changes in cos_agent done to support both pydantic versions fail with

  File "/home/ubuntu/grafana-agent-operator/lib/charms/grafana_agent/v0/cos_agent.py", line 333, in <module>
    if int(pydantic.version.VERSION.split(".")[0]) < 2:  # type: ignore
AttributeError: module 'pydantic.v1' has no attribute 'version'

Solution

Remove objects catering for both pydantic versions and keep just the models for pydantic v1.

Context

Testing Instructions

Upgrade Notes

mmkay commented 3 months ago

Closing in favour of #167.