INNER CODE UNIT · Python

JSONPrinter

weaveworks/kubediff · kubedifflib/_diff.py:243

class JSONPrinter(object):
    def __init__(self):
        self.data = collections.defaultdict(list)

    def add(self, path, kube_obj):
        pass

    def diff(self, path, difference):
        self.data[path].append(difference.to_text())

    def finish(self):
        print(json.dumps(self.data, sort_keys=True, indent=2, separators=(',', ': ')))


def check_files(paths, printer, config):
    """Check all files in 'paths' for differences to a Kubernetes cluster.

    :param printer: Where differences are reported to as they are found.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…