#!/bin/bash

if [ "$1" = apply ]; then
    exit
elif [ "$1" = delete ]; then
    exit
elif [ "$1" = get ]; then
    if [ "$2" = secret -a "$6" = "-o" -a "$7" = 'jsonpath={.data.token}' ]; then
        # base64-encoded string of "fake-token-for-testing"
        echo -n 'ZmFrZS10b2tlbi1mb3ItdGVzdGluZw=='
        exit
    elif [ "$2" = namespaces ]; then
        echo '{"items":[{"metadata":{"name":"default"}}]}'
        exit
    fi
fi
echo 'Unrecognized command'
exit 1
