Skip to content

Contrib/add index listings #40

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jvcdk
Copy link

@jvcdk jvcdk commented Apr 30, 2025

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 file index.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 create index.json; a simple json files listing which resources are available. It will only include files that contain the x-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:

# yaml-language-server: $schema=https://yannh.github.io/kubernetes-json-schema/v1.19.0/pod.json

(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 :)

jvcdk added 3 commits April 30, 2025 13:22
…ting the available resources.

The resources included / listed are those that define the property 'x-kubernetes-group-version-kind'
with an array of objects, each object having the keys 'group', 'kind', and 'version':

  x-kubernetes-group-version-kind: [
    {
      group: ,
      kind: APIGroup,
      version: v1
    },
    ...
  ]

The index.json files are created by the script scripts/update-schema-listing.py.
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.

1 participant