.. versionadded:: 2016.3.0

    Delete label to the current node

    CLI Example:

    .. code-block:: bash

        salt '*' k8s.label_absent hw/disktype
        salt '*' k8s.label_absent hw/disktype kube-node.cluster.local http://kube-master.cluster.local

def label_absent(name, node=None, apiserver_url=None):
    '''
    .. versionadded:: 2016.3.0

    Delete label to the current node

    CLI Example:

    .. code-block:: bash

        salt '*' k8s.label_absent hw/disktype
        salt '*' k8s.label_absent hw/disktype kube-node.cluster.local http://kube-master.cluster.local

    '''
    ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}

    # Get salt minion ID
    node = _guess_node_id(node)
    # Try to get kubernetes master
    apiserver_url = _guess_apiserver(apiserver_url)
    if apiserver_url is None:
        return False

    # Get all labels
    old_labels = _get_labels(node, apiserver_url)
    # Prepare a temp labels dict
    labels = dict([(key, value) for key, value in old_labels.items()
                   if key != name])
    # Compare old labels and what we want
    if labels == old_labels:
        # Label already absent
        ret['comment'] = "Label {0} already absent".format(name)
    else:
        # Label needs to be delete
        res = _set_labels(node, apiserver_url, labels)
        if res.get('status') == 409:
            # there is an update during operation, need to retry
            log.debug("Got 409, will try later")
            ret['changes'] = {}
            ret['comment'] = "Could not delete label {0}, please retry".format(name)
        else:
            ret['changes'] = {"deleted": name}
            ret['comment'] = "Label {0} absent".format(name)

    return ret