Skip to content
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

Update kube schema url to v1.14.0 #108

Merged
merged 1 commit into from
May 24, 2019

Conversation

jburianek
Copy link
Contributor

This seems to fix #58 for me.

Is the fix that straightforward, or is there something I'm missing? Thanks!

@JPinkney
Copy link
Contributor

JPinkney commented Dec 7, 2018

Does autocompletion still work on kind/apiVersion also validation? The problem is that the official schema has this "x-kubernetes-group-version-kind" field in that holds different apiVersion, kind, and group they can be associated with e.g. https://github.com/garethr/kubernetes-json-schema/blob/master/v1.9.9-local/_definitions.json#L24. The problem with this is that it isn't supported by json schema spec and when I was trying to get it to work in the parser I ran into some issue (I cannot remember what the issue was) that made it so you had to transform the schema. IIRC I have a python script somewhere that basically took the "x-kubernetes-group-version-kind" and put it inside of the properties field in a different format that made the schema work correctly. Thats why there is the patched schema in there.

Here is an example of what had to be done. apiVersion became its own field inside of properties with type string and enum v1 (basically the transformed version of x-kubernetes-group-version-kind below).

@jburianek
Copy link
Contributor Author

Ah ok, that makes sense. You're right, that does break autocompletion for apiVersion/kind. I knew I had to be missing something 😃

@jburianek
Copy link
Contributor Author

I'd be interested in that script if you can find it. Might be worthwhile to commit it to source somewhere too.

@JPinkney
Copy link
Contributor

JPinkney commented Dec 7, 2018

I'll try to look for it but if I can't I'll have to wait until after my exams and I'll create a repo or a gist of the code

@coveralls
Copy link

coveralls commented Dec 8, 2018

Coverage Status

Coverage remained the same at 71.855% when pulling a3cf2fc on jburianek:update-kube-schema into 7bbcf2f on redhat-developer:master.

@pengx17
Copy link
Contributor

pengx17 commented Dec 13, 2018

IIRC I have a python script somewhere that basically took the "x-kubernetes-group-version-kind" and put it inside of the properties field in a different format that made the schema work correctly. Thats why there is the patched schema in there.

@JPinkney I am also interested in the script you mentioned here. And good luck to your exams :D

@JPinkney
Copy link
Contributor

@pengx17 I couldn't find the script and was going to write a new one but it looks like @jburianek already has a PR open on the schema side for all the fixes (garethr/kubernetes-json-schema#16).

Awesome work @jburianek !

@jburianek jburianek force-pushed the update-kube-schema branch from e02ded1 to a3cf2fc Compare April 4, 2019 21:10
@jburianek jburianek changed the title Update kube schema url to v1.12.2 Update kube schema url to v1.14.0 Apr 4, 2019
@jburianek
Copy link
Contributor Author

Things have been fixed upstream, so I've updated this PR to point to the JSON schema that should resolve this.

@jburianek
Copy link
Contributor Author

@JPinkney Now that the schema side has been fixed, any chance we could merge this to pick up the latest schema?

@JPinkney
Copy link
Contributor

@jburianek Have you played around with it to make sure everything is okay? (I haven't checked it out yet so I was just wondering if there were any other issues found). If we can't find anything I'll try and cut a release near the end of this week with it in it!

@jburianek
Copy link
Contributor Author

@JPinkney Thanks, yeah I've played around with it and things seem to work as expected.

Before:
Screen Shot 2019-05-21 at 11 55 23 AM
Screen Shot 2019-05-21 at 12 41 57 PM

After:
Screen Shot 2019-05-21 at 11 57 49 AM
Screen Shot 2019-05-21 at 11 53 10 AM

@JPinkney JPinkney merged commit 5f12c7e into redhat-developer:master May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kubernetes apiVersion of extensions is not supoported
4 participants