'Make sure fluentd is on all the labeled nodes. Returns: error list'

@staticmethod
def check_nodes_have_fluentd(pods, fluentd_nodes):

    unmatched_nodes = fluentd_nodes.copy()
    node_names_by_label = {node['metadata']['labels']['kubernetes.io/hostname']: name for (name, node) in fluentd_nodes.items()}
    node_names_by_internal_ip = {address['address']: name for (name, node) in fluentd_nodes.items() for address in node['status']['addresses'] if (address['type'] == 'InternalIP')}
    for pod in pods:
        for name in [pod['spec']['nodeName'], node_names_by_internal_ip.get(pod['spec']['nodeName']), node_names_by_label.get(pod.get('spec', {}).get('host'))]:
            unmatched_nodes.pop(name, None)
    if unmatched_nodes:
        return [OpenShiftCheckException('MissingFluentdPod', 'The    following    nodes    are    supposed    to    have    a    Fluentd    pod    but    do    not:\n        {nodes}\nThese    nodes    will    not    have    their    logs    aggregated.'.format(nodes='\n        '.join(unmatched_nodes.keys())))]
    return []
