0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 21:48:32 +00:00
renovatebot_renovate/lib/modules/manager/sveltos/schema.ts
Oliver Bähler be837b6306
feat(manager): add sveltos manager (#30087)
Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-10-15 09:55:46 +00:00

44 lines
1.3 KiB
TypeScript

import { z } from 'zod';
import { LooseArray } from '../../../util/schema-utils';
import { KubernetesResource } from '../flux/schema';
export const SveltosHelmSource = z.object({
repositoryURL: z.string(),
repositoryName: z.string(),
chartName: z.string(),
chartVersion: z.string(),
});
export type SveltosHelmSource = z.infer<typeof SveltosHelmSource>;
export const SveltosHelmSpec = z.object({
helmCharts: LooseArray(SveltosHelmSource).optional(),
});
export type SveltosHelmSpec = z.infer<typeof SveltosHelmSpec>;
export const ClusterProfile = KubernetesResource.extend({
apiVersion: z.string().startsWith('config.projectsveltos.io/'),
kind: z.literal('ClusterProfile'),
spec: SveltosHelmSpec,
});
export const Profile = KubernetesResource.extend({
apiVersion: z.string().startsWith('config.projectsveltos.io/'),
kind: z.literal('Profile'),
spec: SveltosHelmSpec,
});
export const EventTrigger = KubernetesResource.extend({
apiVersion: z.string().startsWith('lib.projectsveltos.io/'),
kind: z.literal('EventTrigger'),
spec: SveltosHelmSpec,
});
// Create a union schema for ProfileDefinition
export const ProfileDefinition = z.union([
Profile,
ClusterProfile,
EventTrigger,
]);
export type ProfileDefinition = z.infer<typeof ProfileDefinition>;