UNPKG

@soft-stech/fleet

Version:
267 lines (266 loc) 11.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IClusterGroupSchema = 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"); /** * ClusterGroup is a re-usable selector to target a group of clusters. */ exports.IClusterGroupSchema = 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("ClusterGroup"), "metadata": ObjectMeta_schema_1.iObjectMetaSchema.optional(), "spec": zod_1.z.object({ /** * Selector is a label selector, used to select clusters for this group. */ "selector": zod_1.z.object({ /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. */ "matchExpressions": zod_1.z.array(zod_1.z.object({ /** * key is the label key that the selector applies to. */ "key": zod_1.z.string(), /** * operator represents a key's relationship to a set of values. * Valid operators are In, NotIn, Exists and DoesNotExist. */ "operator": zod_1.z.string(), /** * values is an array of string values. If the operator is In or NotIn, * the values array must be non-empty. If the operator is Exists or DoesNotExist, * the values array must be empty. This array is replaced during a strategic * merge patch. */ "values": zod_1.z.array(zod_1.z.string()).optional() })).optional(), /** * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels * map is equivalent to an element of matchExpressions, whose key field is "key", the * operator is "In", and the values array contains only "value". The requirements are ANDed. */ "matchLabels": zod_1.z.record(zod_1.z.string()).optional() }).optional() }).optional(), "status": zod_1.z.object({ /** * ClusterCount is the number of clusters in the cluster group. */ "clusterCount": zod_1.z.number().optional(), /** * Conditions is a list of conditions and their statuses for the cluster group. */ "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(), /** * Display contains the number of ready, desiredready clusters and a * summary state for the bundle's resources. */ "display": zod_1.z.object({ /** * ReadyBundles is a string in the form "%d/%d", that describes the * number of bundles that are ready vs. the number of bundles desired * to be ready. */ "readyBundles": zod_1.z.string().optional(), /** * ReadyClusters is a string in the form "%d/%d", that describes the * number of clusters that are ready vs. the number of clusters desired * to be ready. */ "readyClusters": zod_1.z.string().optional(), /** * State is a summary state for the cluster group, showing "NotReady" if * there are non-ready resources. */ "state": zod_1.z.string().optional() }).optional(), /** * NonReadyClusterCount is the number of clusters that are not ready. */ "nonReadyClusterCount": zod_1.z.number().optional(), /** * NonReadyClusters is a list of cluster names that are not ready. */ "nonReadyClusters": zod_1.z.array(zod_1.z.string()).optional(), /** * ResourceCounts contains the number of resources in each state over * all bundles in the cluster group. */ "resourceCounts": zod_1.z.object({ /** * DesiredReady is the number of resources that should be ready. */ "desiredReady": zod_1.z.number().optional(), /** * Missing is the number of missing resources. */ "missing": zod_1.z.number().optional(), /** * Modified is the number of resources that have been modified. */ "modified": zod_1.z.number().optional(), /** * NotReady is the number of not ready resources. Resources are not * ready if they do not match any other state. */ "notReady": zod_1.z.number().optional(), /** * Orphaned is the number of orphaned resources. */ "orphaned": zod_1.z.number().optional(), /** * Ready is the number of ready resources. */ "ready": zod_1.z.number().optional(), /** * Unknown is the number of resources in an unknown state. */ "unknown": zod_1.z.number().optional(), /** * WaitApplied is the number of resources that are waiting to be applied. */ "waitApplied": zod_1.z.number().optional() }).optional(), /** * Summary is a summary of the bundle deployments and their resources * in the cluster group. */ "summary": zod_1.z.object({ /** * DesiredReady is the number of bundle deployments that should be * ready. */ "desiredReady": zod_1.z.number().optional(), /** * ErrApplied is the number of bundle deployments that have been synced * from the Fleet controller and the downstream cluster, but with some * errors when deploying the bundle. */ "errApplied": zod_1.z.number().optional(), /** * Modified is the number of bundle deployments that have been deployed * and for which all resources are ready, but where some changes from the * Git repository have not yet been synced. */ "modified": zod_1.z.number().optional(), /** * NonReadyClusters is a list of states, which is filled for a bundle * that is not ready. */ "nonReadyResources": zod_1.z.array(zod_1.z.object({ /** * State is the state of the resource, like e.g. "NotReady" or "ErrApplied". */ "bundleState": zod_1.z.string().optional(), /** * Message contains information why the bundle is not ready. */ "message": zod_1.z.string().optional(), /** * ModifiedStatus lists the state for each modified resource. */ "modifiedStatus": zod_1.z.array(zod_1.z.object({ "apiVersion": zod_1.z.string().optional(), "delete": zod_1.z.boolean().optional(), "kind": zod_1.z.string().optional(), "missing": zod_1.z.boolean().optional(), "name": zod_1.z.string().optional(), "namespace": zod_1.z.string().optional(), "patch": zod_1.z.string().optional() })).optional(), /** * Name is the name of the resource. */ "name": zod_1.z.string().optional(), /** * NonReadyStatus lists the state for each non-ready resource. */ "nonReadyStatus": zod_1.z.array(zod_1.z.object({ "apiVersion": zod_1.z.string().optional(), "kind": zod_1.z.string().optional(), "name": zod_1.z.string().optional(), "namespace": zod_1.z.string().optional(), "summary": zod_1.z.object({ "error": zod_1.z.boolean().optional(), "message": zod_1.z.array(zod_1.z.string()).optional(), "state": zod_1.z.string().optional(), "transitioning": zod_1.z.boolean().optional() }).optional(), /** * UID is a type that holds unique ID values, including UUIDs. Because we * don't ONLY use UUIDs, this is an alias to string. Being a type captures * intent and helps make sure that UIDs and names do not get conflated. */ "uid": zod_1.z.string().optional() })).optional() })).optional(), /** * NotReady is the number of bundle deployments that have been deployed * where some resources are not ready. */ "notReady": zod_1.z.number().optional(), /** * OutOfSync is the number of bundle deployments that have been synced * from Fleet controller, but not yet by the downstream agent. */ "outOfSync": zod_1.z.number().optional(), /** * Pending is the number of bundle deployments that are being processed * by Fleet controller. */ "pending": zod_1.z.number().optional(), /** * Ready is the number of bundle deployments that have been deployed * where all resources are ready. */ "ready": zod_1.z.number().optional(), /** * WaitApplied is the number of bundle deployments that have been * synced from Fleet controller and downstream cluster, but are waiting * to be deployed. */ "waitApplied": zod_1.z.number().optional() }).optional() }).optional() });