@soft-stech/spiffe
Version:
82 lines (81 loc) • 3.15 kB
JavaScript
import { z } from "zod";
import { iObjectMetaSchema } from "@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema";
/**
* SpiffeID is the Schema for the spiffeid API
*/
export const ISpiffeIDSchema = 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": z.literal("spiffeid.spiffe.io/v1beta1"),
/**
* 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": z.literal("SpiffeID"),
"metadata": iObjectMetaSchema.optional(),
/**
* SpiffeIDSpec defines the desired state of SpiffeID
*/
"spec": z.object({
"dnsNames": z.array(z.string()).optional(),
"federatesWith": z.array(z.string()).optional(),
"parentId": z.string(),
"downstream": z.boolean().optional(),
"selector": z.object({
/**
* Arbitrary selectors
*/
"arbitrary": z.array(z.string()).optional(),
/**
* Container image to match for this spiffe ID
*/
"containerImage": z.string().optional(),
/**
* Container name to match for this spiffe ID
*/
"containerName": z.string().optional(),
/**
* Namespace to match for this spiffe ID
*/
"namespace": z.string().optional(),
/**
* Node name to match for this spiffe ID
*/
"nodeName": z.string().optional(),
/**
* Pod label name/value to match for this spiffe ID
*/
"podLabel": z.record(z.string()).optional(),
/**
* Pod name to match for this spiffe ID
*/
"podName": z.string().optional(),
/**
* Pod UID to match for this spiffe ID
*/
"podUid": z.string().optional(),
/**
* ServiceAccount to match for this spiffe ID
*/
"serviceAccount": z.string().optional(),
/**
* The k8s_psat cluster name
*/
"cluster": z.string().optional(),
/**
* UID of the node
*/
"agent_node_uid": z.string().optional()
}),
"spiffeId": z.string()
}).optional(),
/**
* SpiffeIDStatus defines the observed state of SpiffeID
*/
"status": z.object({
/**
* INSERT ADDITIONAL STATUS FIELD - define observed state of cluster Important: Run "make" to regenerate code after modifying this file
*/
"entryId": z.string().optional()
}).optional()
});