-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add CustomResource to Python SDK #543
Conversation
c036904
to
2a9af17
Compare
@hausdorff @metral Ok, I think this is ready to go. Semantics are equivalent to the NodeJS SDK, and I tested both with manual creation of CRD/CR and from a YAML manifest. apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: foos.bar.example.com
spec:
group: bar.example.com
versions:
- name: v1
served: true
storage: true
scope: Namespaced
names:
plural: foos
singular: foo
kind: Foo
---
apiVersion: bar.example.com/v1
kind: Foo
metadata:
name: foobar
spec:
foo: "such amaze"
bar: "wow" results in the following:
|
__props__, | ||
__opts__) | ||
|
||
def translate_output_property(self, prop: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that this is going to burn us in the future, though I'm not sure what we can do about it now.
We use the _CASING
tables to convert to and from kubernetesCase
to python_case
, but these tables are derived from the OpenAPI spec. If a custom resource defines a property that isn't in the upstream Kubernetes openAPI spec, it's going to stay in kubernetesCase
, which is going to be annoying.
I don't think there's anything to do here but it's worth noting this possibility.
Fixes #326
Based on #327
This adds CR support to the Python SDK. Here's what it currently looks like:
Compare to the NodeJS SDK: