Giter Site home page Giter Site logo

kubecaml's People

Contributors

andrenth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

rizo

kubecaml's Issues

Error listing pods: Kubecaml.Kubernetes.Definitions.Apimachinery.Pkg.Util.Intstr.Int_or_string.t

Hi there,

Thanks very much for the lib, it's saving me a whole lot of manual generating so far!

I'm currently seeing an issue when trying to list pods:
Kubecaml.Kubernetes.Definitions.Apimachinery.Pkg.Util.Intstr.Int_or_string.t returned during the JSON response parsing.

I think it corresponds to the port field in the response - if the port field is specified as string (referring to a labelled port), the decoding works ok, e.g.:

"readinessProbe": {
  "failureThreshold": 3,
  "httpGet": {
    "path": "/healthz",
    **"port": "http",**
    "scheme": "HTTP"
  }
}

But if the port is referred to as a number, the decoding fails, e.g.:

"readinessProbe": {
  "failureThreshold": 3,
  "httpGet": {
    "path": "/healthz",
    **"port": 10254,**
    "scheme": "HTTP"
  }
}

This seems to be encapsulated by the io.k8s.apimachinery.pkg.util.intstr.IntOrString swagger type, which marks the type as string - so I guess Yojson doesn't like it when it sees a number in the response.

I'll have a look at ocaml-swagger and see if I can figure out a way of making this work - there's an [@encoding `string] option in ppx_deriving_yojson that might help, but I'm not sure how I'd target the ref in question and apply it, so any suggestions would be gratefully received ๐Ÿ˜„

Container_port.create is always partially applied

The signature of the Kubecaml.Kubernetes.Definitions.Api.Core.V1.Container_port.create function does not include the unit argument needed to force the application. This means that all labeled arguments need to be supplied to actually create the value. If only some of the arguments are provided the call results in a partial application.

Here's the demonstration:

# #require "kubecaml";;
# Kubecaml.Kubernetes.Definitions.Api.Core.V1.Container_port.create
     ~name:"xxx"
     ~container_port:8080;;
- : ?protocol:string ->
    ?host_port:int ->
    ?host_ip:string ->
    Kubecaml.Kubernetes.Definitions.Api.Core.V1.Container_port.t
= <fun>
# Kubecaml.Kubernetes.Definitions.Api.Core.V1.Container_port.create
     ~name:"xxx"
     ~container_port:8080
     ?protocol:None
     ?host_port:None
     ?host_ip:None;;
- : Kubecaml.Kubernetes.Definitions.Api.Core.V1.Container_port.t = <abstr>

I'm not sure if this should be reported in the swagger generator library.

Async support

Currently this library doesn't support Jane Street's Async library. It would probably require repackaging.

EDIT: See included pull request:
#5

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.