azimuth-cloud / pyhelm3

Python client for interacting with Helm 3.
Apache License 2.0
49 stars 17 forks source link

Extend type of Chart ref to work with OCI protocol correctly #2

Open NikPaushkin opened 1 year ago

NikPaushkin commented 1 year ago

HTTP links are only allowed now here https://github.com/stackhpc/pyhelm3/blob/main/pyhelm3/models.py#L185. Could use simple str type or implement a custom one since Pydantic (and nobody tbh) doesn't know what OCI protocol is.

NikPaushkin commented 1 year ago

@mkjpryor Hey, do you accept any pull requests?

mkjpryor commented 1 year ago

@NikPaushkin We would welcome a PR to implement this!

Rather than accepting all strings, you should be able to define an OCI URI using stricturl in Pydantic, which can then be added to the union. Something like:

OciUrl = stricturl(allowed_schemes = {"oci"})

This would be my preferred method.

https://docs.pydantic.dev/1.10/usage/types/#urls

nalyat commented 3 weeks ago

@mkjpryor any feedback on the PR? Is there a reason not to merge this one? There's multiple PR's referencing the same issue(https://github.com/azimuth-cloud/pyhelm3/pull/4)