Contrib/add index listings #40
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I implemented two scripts that create/update index files to use for look-up of data in this repo:
scripts/update-versions-listing.sh
creates the fileindex.lst
in project root; this is just a simple text file, one line for each k8s version (excluding-standalone
and-strict
variants).scripts/update-schema-listing.py
run on one of these directories will createindex.json
; a simple json files listing which resources are available. It will only include files that contain thex-kubernetes-group-version-kind
property.I have added these two jobs to the
gen
workflow for GitHub actions, keeping these files up-to-date.In addition to this, I also have a request: Could you enable Github Pages for this repo? Enabling this will publish these files on a url like
https://yannh.github.io/kubernetes-json-schema/v1.19.0/pod.json
, which means I can use them in my yaml code like:(I could also use files via https://raw.githubusercontent.com/, but these urls are longer and thus I get into violation of max line length on my yaml linter)
In the end, I would like to write a small script similar to this one that automatically annotates my yaml files with the above
yaml-language-server
tag. If you enable Github Pages, I will write/adapt the script and contribute it to this repo for others to use as well :)