Coder Social home page Coder Social logo

sernst / kuber Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 5.46 MB

Kubernetes configuration and package management with Python

Home Page: https://kuber.readthedocs.io/en/latest/

License: MIT License

Python 99.94% Makefile 0.01% Batchfile 0.01% Jinja 0.06%
kubernetes kubernetes-manifests python python-3 kubernetes-resources kubernetes-configuration

kuber's People

Contributors

dependabot[bot] avatar sernst avatar

Stargazers

 avatar

Watchers

 avatar  avatar

kuber's Issues

Reading of crds from yaml files fails with RecursionError exception.

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')
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.