add: schema versions in-repo to link to from schemastore.org (#942)

- embed a versions file in the k3d repo that links to the existing config schemas as per https://github.com/SchemaStore/schemastore/pull/2057#issuecomment-1024470105
- inspired by and mostly copied from https://github.com/ory/kratos/blob/master/.schema/version.schema.json 🙏
pull/943/head
Thorsten Klein 3 years ago committed by GitHub
parent aec4507db8
commit f004535ac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 74
      pkg/config/config.versions.meta.schema.json
  2. 36
      pkg/config/config.versions.schema.json
  3. 5
      pkg/config/v1alpha3/schema.json

@ -0,0 +1,74 @@
{
"$id": "https://github.com/rancher/k3d/tree/main/pkg/config/config.versions.meta.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "The meta schema for k3d's config version schemas.",
"type": "object",
"allOf": [
{
"$ref": "http://json-schema.org/draft-07/schema#"
},
{
"properties": {
"oneOf": {
"type": "array",
"items": {
"type": "object",
"required": ["allOf"],
"additionalProperties": false,
"properties": {
"allOf": {
"type": "array",
"additionalItems": false,
"minItems": 2,
"items": [
{
"type": "object",
"required": [
"properties"
],
"additionalProperties": false,
"properties": {
"properties": {
"type": "object",
"required": [
"version"
],
"additionalProperties": false,
"properties": {
"version": {
"type": "object",
"required": [
"const"
],
"additionalProperties": false,
"properties": {
"const": {
"type": "string"
}
}
}
}
}
}
},
{
"type": "object",
"required": [
"$ref"
],
"additionalProperties": false,
"properties": {
"$ref": {
"type": "string"
}
}
}
]
}
}
}
}
}
}
]
}

@ -0,0 +1,36 @@
{
"$id": "https://github.com/rancher/k3d/tree/main/pkg/config/config.versions.schema.json",
"$schema": "https://raw.githubusercontent.com/rancher/k3d/main/pkg/config/config.versions.meta.schema.json#",
"title": "All k3d config versions",
"type": "object",
"oneOf": [
{
"allOf": [
{
"properties": {
"version": {
"const": "v1alpha3"
}
}
},
{
"$ref": "https://raw.githubusercontent.com/rancher/k3d/main/pkg/config/v1alpha3/schema.json"
}
]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v1alpha2"
}
}
},
{
"$ref": "https://raw.githubusercontent.com/rancher/k3d/main/pkg/config/v1alpha2/schema.json"
}
]
}
]
}

@ -163,7 +163,10 @@
"properties": {
"arg": {
"type": "string",
"examples": ["--tls-san=127.0.0.1", "--disable=traefik"]
"examples": [
"--tls-san=127.0.0.1",
"--disable=traefik"
]
},
"nodeFilters": {
"$ref": "#/definitions/nodeFilters"

Loading…
Cancel
Save