You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could add a classmethod to the CustomResourceDefinition object classes which takes a dataclass and returns an instance of the CRD. This classmethod could follow a similar interface to new_class to set things like the name, version and the group.
Here's an example of what this could look like using the kr8s sync API.
The CustomResourceDefinition contains some metadata about the resource such as the name, group, etc and whether it is versioned. It then contains a list of specification versions. The implementation in kubecrd assumes only one version but it would be nice to support multiple. These could be passed as **kwargs as v1 is in the example above, or as a versions= kwarg with a list of dicts to allow configuration of which is served and stored.
This could even be CustomResourceDefinitions implementation of #142 and use the name CustomResourceDefinition.gen(...) instead of CustomResourceDefinition.from_dataclass(...).
The text was updated successfully, but these errors were encountered:
We could add a classmethod to the
CustomResourceDefinition
object classes which takes a dataclass and returns an instance of the CRD. This classmethod could follow a similar interface tonew_class
to set things like the name, version and the group.Here's an example of what this could look like using the
kr8s
sync API.The
from_dataclass
classmethod would need to behave similarly tokubecrd.KubeResourceBase.crd_schema_dict()
.The
CustomResourceDefinition
contains some metadata about the resource such as the name, group, etc and whether it is versioned. It then contains a list of specification versions. The implementation inkubecrd
assumes only one version but it would be nice to support multiple. These could be passed as**kwargs
asv1
is in the example above, or as aversions=
kwarg with a list of dicts to allow configuration of which is served and stored.This could even be
CustomResourceDefinition
s implementation of #142 and use the nameCustomResourceDefinition.gen(...)
instead ofCustomResourceDefinition.from_dataclass(...)
.The text was updated successfully, but these errors were encountered: