UNPKG

@soft-stech/fleet

Version:
769 lines (768 loc) 72 kB
import { addSchema } from "@soft-stech/apimachinery/_schemas/IoK8sApimachineryPkgApisMetaV1ObjectMeta"; import { Model, setSchema, createTypeMetaGuard } from "@soft-stech/base"; import { register } from "@soft-stech/validate"; const schemaId = "fleet.cattle.io.v1alpha1.Cluster"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "fleet.cattle.io/v1alpha1" ] }, "kind": { "type": "string", "enum": [ "Cluster" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "agentAffinity": { "nullable": true, "properties": { "nodeAffinity": { "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "items": { "properties": { "preference": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchFields": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true } }, "type": "object" }, "weight": { "format": "int32", "type": "integer" } }, "required": [ "preference", "weight" ], "type": "object" }, "type": "array", "nullable": true }, "requiredDuringSchedulingIgnoredDuringExecution": { "properties": { "nodeSelectorTerms": { "items": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchFields": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true } }, "type": "object" }, "type": "array" } }, "required": [ "nodeSelectorTerms" ], "type": "object", "nullable": true } }, "type": "object", "nullable": true }, "podAffinity": { "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "items": { "properties": { "podAffinityTerm": { "properties": { "labelSelector": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "matchLabelKeys": { "items": { "type": "string" }, "type": "array", "nullable": true }, "mismatchLabelKeys": { "items": { "type": "string" }, "type": "array", "nullable": true }, "namespaceSelector": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "namespaces": { "items": { "type": "string" }, "type": "array", "nullable": true }, "topologyKey": { "type": "string" } }, "required": [ "topologyKey" ], "type": "object" }, "weight": { "format": "int32", "type": "integer" } }, "required": [ "podAffinityTerm", "weight" ], "type": "object" }, "type": "array", "nullable": true }, "requiredDuringSchedulingIgnoredDuringExecution": { "items": { "properties": { "labelSelector": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "matchLabelKeys": { "items": { "type": "string" }, "type": "array", "nullable": true }, "mismatchLabelKeys": { "items": { "type": "string" }, "type": "array", "nullable": true }, "namespaceSelector": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "namespaces": { "items": { "type": "string" }, "type": "array", "nullable": true }, "topologyKey": { "type": "string" } }, "required": [ "topologyKey" ], "type": "object" }, "type": "array", "nullable": true } }, "type": "object", "nullable": true }, "podAntiAffinity": { "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "items": { "properties": { "podAffinityTerm": { "properties": { "labelSelector": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "matchLabelKeys": { "items": { "type": "string" }, "type": "array", "nullable": true }, "mismatchLabelKeys": { "items": { "type": "string" }, "type": "array", "nullable": true }, "namespaceSelector": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "namespaces": { "items": { "type": "string" }, "type": "array", "nullable": true }, "topologyKey": { "type": "string" } }, "required": [ "topologyKey" ], "type": "object" }, "weight": { "format": "int32", "type": "integer" } }, "required": [ "podAffinityTerm", "weight" ], "type": "object" }, "type": "array", "nullable": true }, "requiredDuringSchedulingIgnoredDuringExecution": { "items": { "properties": { "labelSelector": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "matchLabelKeys": { "items": { "type": "string" }, "type": "array", "nullable": true }, "mismatchLabelKeys": { "items": { "type": "string" }, "type": "array", "nullable": true }, "namespaceSelector": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "namespaces": { "items": { "type": "string" }, "type": "array", "nullable": true }, "topologyKey": { "type": "string" } }, "required": [ "topologyKey" ], "type": "object" }, "type": "array", "nullable": true } }, "type": "object", "nullable": true } }, "type": "object" }, "agentEnvVars": { "items": { "properties": { "name": { "type": "string" }, "value": { "type": "string", "nullable": true }, "valueFrom": { "properties": { "configMapKeyRef": { "properties": { "key": { "type": "string" }, "name": { "default": "", "type": "string", "nullable": true }, "optional": { "type": "boolean", "nullable": true } }, "required": [ "key" ], "type": "object", "nullable": true }, "fieldRef": { "properties": { "apiVersion": { "type": "string", "nullable": true }, "fieldPath": { "type": "string" } }, "required": [ "fieldPath" ], "type": "object", "nullable": true }, "resourceFieldRef": { "properties": { "containerName": { "type": "string", "nullable": true }, "divisor": { "oneOf": [ { "anyOf": [ { "type": "integer" }, { "type": "string" } ], "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$" }, { "type": "null" } ] }, "resource": { "type": "string" } }, "required": [ "resource" ],