Skip to content

nerc-project/openshift-schemas

Repository files navigation

NERC OpenShift Schema Repository

This repository exists to collect OpenAPI schemas from our OpenShift/Kubernetes clusters, patching them if required so that Kustomize can appropriate apply strategic merge patches to lists. We use automated tooling to generate extract individual resource schemas into the schemas/ directory, and then a top level kustomization.yaml file applies patches. The final output is processed with yq to generate a valid OpenAPI document.

Installation

You will need a recent Python, the click package, and yq (this one, not that one).

Adding new schemas

To update this repository with schemas from your currently cluster:

./refresh-schemas.sh

This will:

  1. Fetch OpenAPI schemas from the remote cluster (using ./schemautil fetch)
  2. Split the schema definitions into individual files under the schemas directory (using ./schemautil split)
  3. Re-generate schemas/kustomization.yaml (using ./schemautil kustomize)

At this point, you need to add new schemas to the repository. If you only want new schemas (that is, you want to ignore any modifications to existing schemas), you can do something like this:

git checkout schemas/*/*.json
git add schemas
git commit ...

Generating the merged schema

To generate the final openshift-api-schema.json document, run:

make

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published