Comments (6)
I managed to get OpenShift Routes working by adding the Route components from the openapi-v3.json to your original open API file and rebuilding etc... However, to get the get_yaml() function to work properly on my OSX Mac, I had to use PyYaml as I was getting dictionary's listed in the list values as {} etc... An example of the routes...
y = Route(
spec=RouteSpec(
to=RouteTargetReference(kind="Service", name="service-name"),
host="www.example.com",
path="/test",
),
apiVersion="v1",
kind="Route",
metadata=ObjectMeta(name="route-unsecured"),
)
from hikaru.
I hadn't considered OpenShift support; I've currently been working on connecting Hikaru to the Kubernetes Python client so sending requests is a little more seamless, and was planning subsequently to improve the API in Hikaru to offer a CRUD-like experience. This is an interesting notion though, but I think the build system will need some work as there are lots of artefacts that reflect the inconsistencies in the Kubernetes swagger file. I'm happy for you to leave this as an open request, but I can't make any representations at the moment.
from hikaru.
Hi, being inspired by what you have done, I managed to cobble a Openshift 3.11 version which I have called Pydalio... It uses Pydantic and seems to work fine for a pre-alpha and is pretty basic at the moment... Its at https://github.com/anthcp-infocom/Pydalio. I am using it at work at the moment and have integrated it into the openshift-K8s rest client...
from hikaru.
I just came back from having a look at Pydalio; nice going. Did you modify Hikaru's build.py or did you start from scratch?
This is making me think that the builder might be something to pull out into an independent project. It will need some work to separate out the quirks from straightforward processing.
Someone else suggested pydantic as well. Pydantic is already used in the underlying Kubernetes stuff I have mixed feelings putting it into the Kubernetes Hikaru build as it feels slightly like overkill, but more importantly there are other features I'd consider activating via properties and I'm not sure that using pydantic will make those harder to put in place later.
from hikaru.
I experimented with datamodel-codegen (https://github.com/koxudaxi/datamodel-code-generator) to convert the openapi spec Openshift 3.11 file to Pydantic python objects and found it worked a treat! From there I just build some functions as you can see to use at work to replace helm... It was your work that inspired me to do this!!!
from hikaru.
Well cool! I guess I'll close this out then, but if you want to revisit in the future then just open again or create a new one.
from hikaru.
Related Issues (20)
- Error when trying to patch/replace an object HOT 7
- Generated code not using 'body' argument in 'deleteCollection' methods HOT 1
- Add a 'merge()' method to HikaruBase HOT 1
- CRUD-style support HOT 4
- Wrong object type created despite calling hikaru.register_version_kind_class HOT 5
- Black maybe better be a dev dependency HOT 5
- Node from_dict fails on required field port (in DeamonEndpoint) HOT 3
- List methods aren't assigned to classes consistently HOT 4
- obj.metadata.selfLink is always None HOT 3
- convert underscore to dash implicitely in _clean_dict may introduce in un-expected labels HOT 5
- Hikaru functions should return a specific type HOT 3
- support for auto-generation HOT 4
- VolumeSnapshot missing HOT 11
- deserialize/serialize yaml preserving comments and formatting HOT 1
- Support for Argo Workflows? HOT 4
- Support for K8s v1.25 HOT 5
- Unpin Black version HOT 2
- PodStatus's podIP and hostIP attributes are not set on readNamespacedPod(...) HOT 3
- Import errors HOT 2
- Support dictionary lookups in object_at_path HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hikaru.