UNPKG

@soft-stech/flux-cd

Version:
486 lines (485 loc) 17.9 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.v1.Kustomization"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "kustomize.toolkit.fluxcd.io/v1" ] }, "kind": { "type": "string", "enum": [ "Kustomization" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "commonMetadata": { "properties": { "annotations": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true }, "labels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object", "nullable": true }, "components": { "items": { "type": "string" }, "type": "array", "nullable": true }, "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", "pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$" }, "kubeConfig": { "properties": { "secretRef": { "properties": { "key": { "type": "string", "nullable": true }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" } }, "required": [ "secretRef" ], "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 }, "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" }, "optional": { "default": false, "type": "boolean", "nullable": true } }, "required": [ "kind", "name" ], "type": "object" }, "type": "array", "nullable": true } }, "type": "object", "nullable": true }, "prune": { "type": "boolean" }, "retryInterval": { "type": "string", "pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$", "nullable": true }, "serviceAccountName": { "type": "string", "nullable": true }, "sourceRef": { "properties": { "apiVersion": { "type": "string", "nullable": true }, "kind": { "enum": [ "OCIRepository", "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", "pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$", "nullable": true }, "wait": { "type": "boolean", "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 }, "inventory": { "properties": { "entries": { "items": { "properties": { "id": { "type": "string" }, "v": { "type": "string" } }, "required": [ "id", "v" ], "type": "object" }, "type": "array" } }, "required": [ "entries" ], "type": "object", "nullable": true }, "lastAppliedRevision": { "type": "string", "nullable": true }, "lastAttemptedRevision": { "type": "string", "nullable": true }, "lastHandledReconcileAt": { "type": "string", "nullable": true }, "observedGeneration": { "format": "int64", "type": "integer", "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/v1"; Kustomization.kind = "Kustomization"; Kustomization.is = createTypeMetaGuard(Kustomization); setSchema(Kustomization, schemaId, () => { addSchema(); register(schemaId, schema); });