INNER CODE UNIT · Python

normalize

weaveworks/kubediff · kubedifflib/_diff.py:133

def normalize(value):
    if isinstance(value, numbers.Number):
        return str(value)
    if value == [] or value == {}:
        return None
    return value


def diff(path, want, have):
    want = normalize(want)
    have = normalize(have)

    for (toleration_path, toleration_check) in listitems(tolerations):
        if fnmatchcase(path, toleration_path) and toleration_check(want, have):
            return

    if isinstance(want, dict) and isinstance(have, dict):
        for difference in diff_dicts(path, want, have):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…