UNPKG

@soft-stech/keda

Version:
632 lines (631 loc) 467 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 = "keda.sh.v1alpha1.ScaledJob"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "keda.sh/v1alpha1" ] }, "kind": { "type": "string", "enum": [ "ScaledJob" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "envSourceContainerName": { "type": "string", "nullable": true }, "failedJobsHistoryLimit": { "format": "int32", "type": "integer", "nullable": true }, "jobTargetRef": { "properties": { "activeDeadlineSeconds": { "format": "int64", "type": "integer", "nullable": true }, "backoffLimit": { "format": "int32", "type": "integer", "nullable": true }, "completionMode": { "type": "string", "nullable": true }, "completions": { "format": "int32", "type": "integer", "nullable": true }, "manualSelector": { "type": "boolean", "nullable": true }, "parallelism": { "format": "int32", "type": "integer", "nullable": true }, "podFailurePolicy": { "properties": { "rules": { "items": { "properties": { "action": { "type": "string" }, "onExitCodes": { "properties": { "containerName": { "type": "string", "nullable": true }, "operator": { "type": "string" }, "values": { "items": { "format": "int32", "type": "integer" }, "type": "array" } }, "required": [ "operator", "values" ], "type": "object", "nullable": true }, "onPodConditions": { "items": { "properties": { "status": { "type": "string" }, "type": { "type": "string" } }, "required": [ "status", "type" ], "type": "object" }, "type": "array" } }, "required": [ "action", "onPodConditions" ], "type": "object" }, "type": "array" } }, "required": [ "rules" ], "type": "object", "nullable": true }, "selector": { "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 }, "suspend": { "type": "boolean", "nullable": true }, "template": { "properties": { "metadata": { "type": "object", "properties": {}, "nullable": true }, "spec": { "properties": { "activeDeadlineSeconds": { "format": "int64", "type": "integer", "nullable": true }, "affinity": { "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 }, "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 }, "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 }, "namespaceSelector": { "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array",