We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46521c5 commit 450910eCopy full SHA for 450910e
apps/supervisor/src/env.ts
@@ -196,13 +196,22 @@ const Env = z
196
197
const keyValue = entry.slice(0, colonIdx);
198
const eqIdx = keyValue.indexOf("=");
199
+ const key = eqIdx === -1 ? keyValue : keyValue.slice(0, eqIdx);
200
+
201
+ if (!key) {
202
+ ctx.addIssue({
203
+ code: z.ZodIssueCode.custom,
204
+ message: `Invalid toleration format (empty key): "${entry}"`,
205
+ });
206
+ return z.NEVER;
207
+ }
208
209
if (eqIdx === -1) {
- return { key: keyValue, operator: "Exists" as const, effect };
210
+ return { key, operator: "Exists" as const, effect };
211
}
212
213
return {
- key: keyValue.slice(0, eqIdx),
214
+ key,
215
operator: "Equal" as const,
216
value: keyValue.slice(eqIdx + 1),
217
effect,
0 commit comments