UNPKG

@soft-stech/fleet

Version:
166 lines (165 loc) 6.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IImageScanSchema = void 0; // Generated by ts-to-zod const zod_1 = require("zod"); const ObjectMeta_schema_1 = require("@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema"); exports.IImageScanSchema = zod_1.z.object({ /** * APIVersion defines the versioned schema of this representation of an object. * Servers should convert recognized schemas to the latest internal value, and * may reject unrecognized values. * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion: zod_1.z.literal("fleet.cattle.io/v1alpha1"), /** * Kind is a string value representing the REST resource this object represents. * Servers may infer this from the endpoint the client submits requests to. * Cannot be updated. * In CamelCase. * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind: zod_1.z.literal("ImageScan"), metadata: ObjectMeta_schema_1.iObjectMetaSchema.optional(), /** * API is taken from https://github.com/fluxcd/image-reflector-controller */ spec: zod_1.z .object({ /** * GitRepo reference name */ gitrepoName: zod_1.z.string().optional(), /** * Image is the name of the image repository */ image: zod_1.z.string().optional(), /** * Interval is the length of time to wait between * scans of the image repository. */ interval: zod_1.z.string().optional(), /** * Policy gives the particulars of the policy to be followed in * selecting the most recent image */ policy: zod_1.z .object({ /** * Alphabetical set of rules to use for alphabetical ordering of the tags. */ alphabetical: zod_1.z .object({ /** * Order specifies the sorting order of the tags. Given the letters of the * alphabet as tags, ascending order would select Z, and descending order * would select A. */ order: zod_1.z.string().optional() }) .optional(), /** * SemVer gives a semantic version range to check against the tags * available. */ semver: zod_1.z .object({ /** * Range gives a semver range for the image tag; the highest * version within the range that's a tag yields the latest image. */ range: zod_1.z.string().optional() }) .optional() }) .optional(), /** * SecretRef can be given the name of a secret containing * credentials to use for the image registry. The secret should be * created with `kubectl create secret docker-registry`, or the * equivalent. */ secretRef: zod_1.z .object({ /** * Name of the referent. * This field is effectively required, but due to backwards compatibility is * allowed to be empty. Instances of this type with an empty value here are * almost certainly wrong. * TODO: Add other useful fields. apiVersion, kind, uid? * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names * TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. */ name: zod_1.z.string().optional() }) .optional(), /** * This flag tells the controller to suspend subsequent image scans. * It does not apply to already started scans. Defaults to false. */ suspend: zod_1.z.boolean().optional(), /** * TagName is the tag ref that needs to be put in manifest to replace fields */ tagName: zod_1.z.string().optional() }) .optional(), status: zod_1.z .object({ /** * CanonicalName is the name of the image repository with all the * implied bits made explicit; e.g., `docker.io/library/alpine` * rather than `alpine`. */ canonicalImageName: zod_1.z.string().optional(), conditions: zod_1.z .array(zod_1.z.object({ /** * Last time the condition transitioned from one status to another. */ lastTransitionTime: zod_1.z.string().optional(), /** * The last time this condition was updated. */ lastUpdateTime: zod_1.z.string().optional(), /** * Human-readable message indicating details about last transition */ message: zod_1.z.string().optional(), /** * The reason for the condition's last transition. */ reason: zod_1.z.string().optional(), /** * Status of the condition, one of True, False, Unknown. */ status: zod_1.z.string(), /** * Type of cluster condition. */ type: zod_1.z.string() })) .optional(), /** * LastScanTime is the last time image was scanned * @format date-time */ lastScanTime: zod_1.z.iso.datetime().optional().nullable(), /** * LatestDigest is the digest of latest tag */ latestDigest: zod_1.z.string().optional(), /** * LatestImage gives the first in the list of images scanned by * the image repository, when filtered and ordered according to * the policy. */ latestImage: zod_1.z.string().optional(), /** * Latest tag is the latest tag filtered by the policy */ latestTag: zod_1.z.string().optional(), observedGeneration: zod_1.z.number().optional() }) .optional() });