monokle-core
monokle-core copied to clipboard
Adjust readConfig() function to configurable rules
Follow up of https://github.com/kubeshop/monokle-core/issues/435.
The above task fixed some issues with readConfig() function but I realized it's still not aligned with configurable rules which accepts more extensive schema/types.
We have there now:
https://github.com/kubeshop/monokle-core/blob/89f220f48954148c9ade3ba201ea522e7370ba7e/packages/validation/src/config/parse.ts#L35
And should be:
rules: z
.record(
z
.boolean()
.or(z.enum(['warn', 'err']))
.or(
z.tuple([
z.boolean().or(z.enum(['warn', 'err'])),
z
.string()
.or(z.number())
.or(z.array(z.string()))
.or(z.array(z.number())),
]),
),
)
.optional(),