def _get_update_labels(existing_labels, input_labels):
    """
    Helper function to add new labels, delete labels, override
    existing labels

    Args:
        existing_labels(dict): Existing node labels
        input_labels(dict): Input/Req. labels
    Returns:
        update_labels(dict): Node labels to be updated
        or
        input_labels(dict): Node labels to be updated
    """
    update_labels = {}

    # no existing labels found
    if not existing_labels:
        # filter delete label request since there is no labels set on a node
        update_labels.update(
            {k: v
             for k, v in input_labels.items() if v is not None})
        return update_labels

    # new labels or overriding labels
    update_labels.update({
        k: v
        for k, v in input_labels.items()
        if k not in existing_labels or v != existing_labels[k]
    })

    # deleted labels
    update_labels.update({
        k: None
        for k in existing_labels.keys()
        if k not in input_labels and "kubernetes.io" not in k
    })
    return update_labels