UNPKG

@soft-stech/flux-cd

Version:
544 lines (543 loc) 20.8 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 = "kustomize.toolkit.fluxcd.io.v1beta1.Kustomization"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "kustomize.toolkit.fluxcd.io/v1beta1" ] }, "kind": { "type": "string", "enum": [ "Kustomization" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "decryption": { "properties": { "provider": { "enum": [ "sops" ], "type": "string" }, "secretRef": { "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object", "nullable": true } }, "required": [ "provider" ], "type": "object", "nullable": true }, "dependsOn": { "items": { "properties": { "name": { "type": "string" }, "namespace": { "type": "string", "nullable": true } }, "required": [ "name" ], "type": "object" }, "type": "array", "nullable": true }, "force": { "default": false, "type": "boolean", "nullable": true }, "healthChecks": { "items": { "properties": { "apiVersion": { "type": "string", "nullable": true }, "kind": { "type": "string" }, "name": { "type": "string" }, "namespace": { "type": "string", "nullable": true } }, "required": [ "kind", "name" ], "type": "object" }, "type": "array", "nullable": true }, "images": { "items": { "properties": { "digest": { "type": "string", "nullable": true }, "name": { "type": "string" }, "newName": { "type": "string", "nullable": true }, "newTag": { "type": "string", "nullable": true } }, "required": [ "name" ], "type": "object" }, "type": "array", "nullable": true }, "interval": { "type": "string" }, "kubeConfig": { "properties": { "secretRef": { "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object", "nullable": true } }, "type": "object", "nullable": true }, "patches": { "items": { "properties": { "patch": { "type": "string" }, "target": { "properties": { "annotationSelector": { "type": "string", "nullable": true }, "group": { "type": "string", "nullable": true }, "kind": { "type": "string", "nullable": true }, "labelSelector": { "type": "string", "nullable": true }, "name": { "type": "string", "nullable": true }, "namespace": { "type": "string", "nullable": true }, "version": { "type": "string", "nullable": true } }, "type": "object", "nullable": true } }, "required": [ "patch" ], "type": "object" }, "type": "array", "nullable": true }, "patchesJson6902": { "items": { "properties": { "patch": { "items": { "properties": { "from": { "type": "string", "nullable": true }, "op": { "enum": [ "test", "remove", "add", "replace", "move", "copy" ], "type": "string" }, "path": { "type": "string" }, "value": { "oneOf": [ {}, { "type": "null" } ] } }, "required": [ "op", "path" ], "type": "object" }, "type": "array" }, "target": { "properties": { "annotationSelector": { "type": "string", "nullable": true }, "group": { "type": "string", "nullable": true }, "kind": { "type": "string", "nullable": true }, "labelSelector": { "type": "string", "nullable": true }, "name": { "type": "string", "nullable": true }, "namespace": { "type": "string", "nullable": true }, "version": { "type": "string", "nullable": true } }, "type": "object" } }, "required": [ "patch", "target" ], "type": "object" }, "type": "array", "nullable": true }, "patchesStrategicMerge": { "items": {}, "type": "array", "nullable": true }, "path": { "type": "string", "nullable": true }, "postBuild": { "properties": { "substitute": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true }, "substituteFrom": { "items": { "properties": { "kind": { "enum": [ "Secret", "ConfigMap" ], "type": "string" }, "name": { "maxLength": 253, "minLength": 1, "type": "string" } }, "required": [ "kind", "name" ], "type": "object" }, "type": "array", "nullable": true } }, "type": "object", "nullable": true }, "prune": { "type": "boolean" }, "retryInterval": { "type": "string", "nullable": true }, "serviceAccountName": { "type": "string", "nullable": true }, "sourceRef": { "properties": { "apiVersion": { "type": "string", "nullable": true }, "kind": { "enum": [ "GitRepository", "Bucket" ], "type": "string" }, "name": { "type": "string" }, "namespace": { "type": "string", "nullable": true } }, "required": [ "kind", "name" ], "type": "object" }, "suspend": { "type": "boolean", "nullable": true }, "targetNamespace": { "maxLength": 63, "minLength": 1, "type": "string", "nullable": true }, "timeout": { "type": "string", "nullable": true }, "validation": { "enum": [ "none", "client", "server" ], "type": "string", "nullable": true } }, "required": [ "interval", "prune", "sourceRef" ], "type": "object", "nullable": true }, "status": { "default": { "observedGeneration": -1 }, "properties": { "conditions": { "items": { "properties": { "lastTransitionTime": { "format": "date-time", "type": "string" }, "message": { "maxLength": 32768, "type": "string" }, "observedGeneration": { "format": "int64", "type": "integer", "minimum": 0, "nullable": true }, "reason": { "maxLength": 1024, "minLength": 1, "type": "string", "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$" }, "status": { "enum": [ "True", "False", "Unknown" ], "type": "string" }, "type": { "maxLength": 316, "type": "string", "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\\/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$" } }, "required": [ "lastTransitionTime", "message", "reason", "status", "type" ], "type": "object" }, "type": "array", "nullable": true }, "lastAppliedRevision": { "type": "string", "nullable": true }, "lastAttemptedRevision": { "type": "string", "nullable": true }, "lastHandledReconcileAt": { "type": "string", "nullable": true }, "observedGeneration": { "format": "int64", "type": "integer", "nullable": true }, "snapshot": { "properties": { "checksum": { "type": "string" }, "entries": { "items": { "properties": { "kinds": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {} }, "namespace": { "type": "string", "nullable": true } }, "required": [ "kinds" ], "type": "object" }, "type": "array" } }, "required": [ "checksum", "entries" ], "type": "object", "nullable": true } }, "type": "object", "nullable": true } }, "required": [ "apiVersion", "kind" ] }; /** * Kustomization is the Schema for the kustomizations API. */ export class Kustomization extends Model { constructor(data) { super({ apiVersion: Kustomization.apiVersion, kind: Kustomization.kind, ...data }); } } Kustomization.apiVersion = "kustomize.toolkit.fluxcd.io/v1beta1"; Kustomization.kind = "Kustomization"; Kustomization.is = createTypeMetaGuard(Kustomization); setSchema(Kustomization, schemaId, () => { addSchema(); register(schemaId, schema); });