UNPKG

@soft-stech/fleet

Version:
182 lines (181 loc) 5.85 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.ImageScan"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "fleet.cattle.io/v1alpha1" ] }, "kind": { "type": "string", "enum": [ "ImageScan" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "gitrepoName": { "nullable": true, "type": "string" }, "image": { "nullable": true, "type": "string" }, "interval": { "nullable": true, "type": "string" }, "policy": { "properties": { "alphabetical": { "nullable": true, "properties": { "order": { "nullable": true, "type": "string" } }, "type": "object" }, "semver": { "nullable": true, "properties": { "range": { "nullable": true, "type": "string" } }, "type": "object" } }, "type": "object", "nullable": true }, "secretRef": { "nullable": true, "properties": { "name": { "default": "", "type": "string", "nullable": true } }, "type": "object" }, "suspend": { "type": "boolean", "nullable": true }, "tagName": { "nullable": true, "type": "string" } }, "type": "object", "nullable": true }, "status": { "properties": { "canonicalImageName": { "type": "string", "nullable": true }, "conditions": { "items": { "properties": { "lastTransitionTime": { "type": "string", "nullable": true }, "lastUpdateTime": { "type": "string", "nullable": true }, "message": { "type": "string", "nullable": true }, "reason": { "type": "string", "nullable": true }, "status": { "type": "string" }, "type": { "type": "string" } }, "required": [ "status", "type" ], "type": "object" }, "type": "array", "nullable": true }, "lastScanTime": { "format": "date-time", "type": "string", "nullable": true }, "latestDigest": { "type": "string", "nullable": true }, "latestImage": { "type": "string", "nullable": true }, "latestTag": { "type": "string", "nullable": true }, "observedGeneration": { "format": "int64", "type": "integer", "nullable": true } }, "type": "object", "nullable": true } }, "required": [ "apiVersion", "kind" ] }; export class ImageScan extends Model { constructor(data) { super({ apiVersion: ImageScan.apiVersion, kind: ImageScan.kind, ...data }); } } ImageScan.apiVersion = "fleet.cattle.io/v1alpha1"; ImageScan.kind = "ImageScan"; ImageScan.is = createTypeMetaGuard(ImageScan); setSchema(ImageScan, schemaId, () => { addSchema(); register(schemaId, schema); });