UNPKG

@soft-stech/flux-cd

Version:
212 lines (211 loc) 7.42 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 = "image.toolkit.fluxcd.io.v1beta2.ImagePolicy"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "image.toolkit.fluxcd.io/v1beta2" ] }, "kind": { "type": "string", "enum": [ "ImagePolicy" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "filterTags": { "properties": { "extract": { "type": "string", "nullable": true }, "pattern": { "type": "string", "nullable": true } }, "type": "object", "nullable": true }, "imageRepositoryRef": { "properties": { "name": { "type": "string" }, "namespace": { "type": "string", "nullable": true } }, "required": [ "name" ], "type": "object" }, "policy": { "properties": { "alphabetical": { "properties": { "order": { "default": "asc", "enum": [ "asc", "desc" ], "type": "string", "nullable": true } }, "type": "object", "nullable": true }, "numerical": { "properties": { "order": { "default": "asc", "enum": [ "asc", "desc" ], "type": "string", "nullable": true } }, "type": "object", "nullable": true }, "semver": { "properties": { "range": { "type": "string" } }, "required": [ "range" ], "type": "object", "nullable": true } }, "type": "object" } }, "required": [ "imageRepositoryRef", "policy" ], "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 }, "latestImage": { "type": "string", "nullable": true }, "observedGeneration": { "format": "int64", "type": "integer", "nullable": true }, "observedPreviousImage": { "type": "string", "nullable": true } }, "type": "object", "nullable": true } }, "required": [ "apiVersion", "kind" ] }; /** * ImagePolicy is the Schema for the imagepolicies API */ export class ImagePolicy extends Model { constructor(data) { super({ apiVersion: ImagePolicy.apiVersion, kind: ImagePolicy.kind, ...data }); } } ImagePolicy.apiVersion = "image.toolkit.fluxcd.io/v1beta2"; ImagePolicy.kind = "ImagePolicy"; ImagePolicy.is = createTypeMetaGuard(ImagePolicy); setSchema(ImagePolicy, schemaId, () => { addSchema(); register(schemaId, schema); });