fix(kubernetes): allow merging options if strings are equal

This commit is contained in:
Jaka Hudoklin 2018-04-06 18:48:23 +02:00
parent c1dda2b22f
commit a4526cc8c3

View file

@ -12,11 +12,18 @@ let
hasAttr "type" def && hasAttr "type" def &&
elem def.type ["string" "integer" "boolean" "object"]; elem def.type ["string" "integer" "boolean" "object"];
str = mkOptionType {
name = "str";
description = "string";
check = isString;
merge = mergeEqualOption;
};
mapType = def: mapType = def:
if def.type == "string" then if def.type == "string" then
if hasAttr "format" def && def.format == "int-or-string" if hasAttr "format" def && def.format == "int-or-string"
then types.either types.int types.str then types.either types.int str
else types.str else str
else if def.type == "integer" then types.int else if def.type == "integer" then types.int
else if def.type == "boolean" then types.bool else if def.type == "boolean" then types.bool
else if def.type == "object" then types.attrs else if def.type == "object" then types.attrs