@soft-stech/fleet
Version:
52 lines (51 loc) • 2.2 kB
JavaScript
import { z } from "zod";
import { iObjectMetaSchema } from "@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema";
/**
* GitRepoRestriction is a resource that can optionally be used to restrict
* the options of GitRepos in the same namespace.
*/
export const IGitRepoRestrictionSchema = z.object({
/**
* AllowedClientSecretNames is a list of client secret names that GitRepos are allowed to use.
*/
allowedClientSecretNames: z.array(z.string()).optional(),
/**
* AllowedRepoPatterns is a list of regex patterns that restrict the
* valid values of the Repo field of a GitRepo.
*/
allowedRepoPatterns: z.array(z.string()).optional(),
/**
* AllowedServiceAccounts is a list of service accounts that GitRepos are allowed to use.
*/
allowedServiceAccounts: z.array(z.string()).optional(),
/**
* AllowedTargetNamespaces restricts TargetNamespace to the given
* namespaces. If AllowedTargetNamespaces is set, TargetNamespace must
* be set.
*/
allowedTargetNamespaces: z.array(z.string()).optional(),
/**
* 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("fleet.cattle.io/v1alpha1"),
/**
* DefaultClientSecretName overrides the GitRepo's default client secret.
*/
defaultClientSecretName: z.string().optional(),
/**
* DefaultServiceAccount overrides the GitRepo's default service account.
*/
defaultServiceAccount: z.string().optional(),
/**
* 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("GitRepoRestriction"),
metadata: iObjectMetaSchema.optional()
});