UNPKG

@soft-stech/fleet

Version:
91 lines (90 loc) 2.6 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.ClusterRegistration"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "fleet.cattle.io/v1alpha1" ] }, "kind": { "type": "string", "enum": [ "ClusterRegistration" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "clientID": { "nullable": true, "type": "string" }, "clientRandom": { "nullable": true, "type": "string" }, "clusterLabels": { "additionalProperties": { "type": "string" }, "nullable": true, "type": "object", "properties": {} } }, "type": "object", "nullable": true }, "status": { "properties": { "clusterName": { "nullable": true, "type": "string" }, "granted": { "type": "boolean", "nullable": true } }, "type": "object", "nullable": true } }, "required": [ "apiVersion", "kind" ] }; /** * ClusterRegistration is used internally by Fleet and should not be used directly. */ export class ClusterRegistration extends Model { constructor(data) { super({ apiVersion: ClusterRegistration.apiVersion, kind: ClusterRegistration.kind, ...data }); } } ClusterRegistration.apiVersion = "fleet.cattle.io/v1alpha1"; ClusterRegistration.kind = "ClusterRegistration"; ClusterRegistration.is = createTypeMetaGuard(ClusterRegistration); setSchema(ClusterRegistration, schemaId, () => { addSchema(); register(schemaId, schema); });