def secret_absent(name, namespace='default', **kwargs):
    '''
    Ensures that the named secret is absent from the given namespace.

    name
        The name of the secret

    namespace
        The name of the namespace
    '''

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

    secret = __salt__['kubernetes.show_secret'](name, namespace, **kwargs)

    if secret is None:
        ret['result'] = True if not __opts__['test'] else None
        ret['comment'] = 'The secret does not exist'
        return ret

    if __opts__['test']:
        ret['comment'] = 'The secret is going to be deleted'
        ret['result'] = None
        return ret

    __salt__['kubernetes.delete_secret'](name, namespace, **kwargs)

    # As for kubernetes 1.6.4 doesn't set a code when deleting a secret
    # The kubernetes module will raise an exception if the kubernetes
    # server will return an error
    ret['result'] = True
    ret['changes'] = {
        'kubernetes.secret': {
            'new': 'absent', 'old': 'present'}}
    ret['comment'] = 'Secret deleted'
    return ret
def secret_absent ( name , namespace = 'default' , ** kwargs ) : ret = { 'name' : name , 'changes' : { } , 'result' : False , 'comment' : '' } secret = __salt__ [ 'kubernetes.show_secret' ] ( name , namespace , ** kwargs ) if secret is None : ret [ 'result' ] = True if not __opts__ [ 'test' ] else None ret [ 'comment' ] = 'The secret does not exist' return ret if __opts__ [ 'test' ] : ret [ 'comment' ] = 'The secret is going to be deleted' ret [ 'result' ] = None return ret __salt__ [ 'kubernetes.delete_secret' ] ( name , namespace , ** kwargs ) ret [ 'result' ] = True ret [ 'changes' ] = { 'kubernetes.secret' : { 'new' : 'absent' , 'old' : 'present' } } ret [ 'comment' ] = 'Secret deleted' return ret
Ensures that the named secret is absent from the given namespace.

    name
        The name of the secret

    namespace
        The name of the namespace