sernst / kuber Goto Github PK
View Code? Open in Web Editor NEWKubernetes configuration and package management with Python
Home Page: https://kuber.readthedocs.io/en/latest/
License: MIT License
Kubernetes configuration and package management with Python
Home Page: https://kuber.readthedocs.io/en/latest/
License: MIT License
Hey @sernst. Wanted to say this is a great module.
When trying to read a crd from yaml files. I get a RecursionError
exception. I have tested this with kuber 1.7.0 on cpython 3.7.3. The python and yaml code used for testing are further down below. I also test it with equivalent json code.
I am unsure, if this is issue originates from kuber or some underlying module.
Traceback (most recent call last):
File "crd.py", line 5, in <module>
.add_file('crd.yml')
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/management/__init__.py", line 279, in add_file
version
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/management/creation.py", line 49, in from_yaml_file_multiple
return from_yaml_multiple(f.read(), kubernetes_version)
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/management/creation.py", line 70, in from_yaml_multiple
for d in resources_definitions.split('\n---')
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/management/creation.py", line 70, in <listcomp>
for d in resources_definitions.split('\n---')
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/management/creation.py", line 90, in from_yaml
return from_dict(data, kubernetes_version)
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/management/creation.py", line 171, in from_dict
resource: Resource = resource_class()
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/latest/apiextensions_v1beta1.py", line 296, in __init__
'spec': spec or CustomResourceDefinitionSpec(),
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/latest/apiextensions_v1beta1.py", line 887, in __init__
'validation': validation or CustomResourceValidation(),
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/latest/apiextensions_v1beta1.py", line 1644, in __init__
'openAPIV3Schema': open_apiv3_schema or JSONSchemaProps(),
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/latest/apiextensions_v1beta1.py", line 1843, in __init__
'not': not_ or JSONSchemaProps(),
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/latest/apiextensions_v1beta1.py", line 1843, in __init__
'not': not_ or JSONSchemaProps(),
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/latest/apiextensions_v1beta1.py", line 1843, in __init__
'not': not_ or JSONSchemaProps(),
[Previous line repeated 486 more times]
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/latest/apiextensions_v1beta1.py", line 1818, in __init__
'additionalItems': additional_items or JSONSchemaPropsOrBool(),
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/latest/apiextensions_v1beta1.py", line 2478, in __init__
kind='JSONSchemaPropsOrBool'
File "/home/michael/.local/share/virtualenvs/kuber-zAnbfxPg/lib/python3.7/site-packages/kuber/definitions.py", line 44, in __init__
self._kuber_uid = str(uuid.uuid4())
File "/usr/lib64/python3.7/uuid.py", line 759, in uuid4
return UUID(bytes=os.urandom(16), version=4)
File "/usr/lib64/python3.7/uuid.py", line 153, in __init__
if [hex, bytes, bytes_le, fields, int].count(None) != 4:
RecursionError: maximum recursion depth exceeded in comparison
CRD yaml file used for testing. Copied from kubenetes.io.
apiVersion: apiextensions/v1beta1
kind: CustomResourceDefinition
metadata:
name: crontabs.stable.example.com
spec:
group: stable.example.com
versions:
- name: v1
served: true
storage: true
scope: Namespaced
names:
plural: crontabs
singular: crontab
kind: CronTab
shortNames:
- ct
The python code used:
resource_bundle = (
kuber.create_bundle(kubernetes_version='latest')
.add_file('crd.yml')
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.