@soft-stech/fleet
Version:
62 lines (61 loc) • 2.56 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IClusterRegistrationSchema = 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");
/**
* ClusterRegistration is used internally by Fleet and should not be used directly.
*/
exports.IClusterRegistrationSchema = 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("ClusterRegistration"),
metadata: ObjectMeta_schema_1.iObjectMetaSchema.optional(),
spec: zod_1.z
.object({
/**
* ClientID is a unique string that will identify the cluster. The
* agent either uses the configured ID or the kubeSystem.UID.
*/
clientID: zod_1.z.string().optional(),
/**
* ClientRandom is a random string that the agent generates. When
* fleet-controller grants a registration, it creates a registration
* secret with this string in the name.
*/
clientRandom: zod_1.z.string().optional(),
/**
* ClusterLabels are copied to the cluster resource during the registration.
*/
clusterLabels: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional()
})
.optional(),
status: zod_1.z
.object({
/**
* ClusterName is only set after the registration is being processed by
* fleet-controller.
*/
clusterName: zod_1.z.string().optional(),
/**
* Granted is set to true, if the request service account is present
* and its token secret exists. This happens directly before creating
* the registration secret, roles and rolebindings.
*/
granted: zod_1.z.boolean().optional()
})
.optional()
});