From 15c8eb52d0e62f973b59ac4c881f671cdf4cf0e8 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Tue, 19 Apr 2022 17:22:42 +0200 Subject: [PATCH] Remove kdjango function as it's now a kubectl plugin --- .../fish/private_functions/.chezmoiremove | 2 + .../private_functions/private_kdjango.fish | 37 ------------------- 2 files changed, 2 insertions(+), 37 deletions(-) create mode 100644 dot_config/fish/private_functions/.chezmoiremove delete mode 100644 dot_config/fish/private_functions/private_kdjango.fish diff --git a/dot_config/fish/private_functions/.chezmoiremove b/dot_config/fish/private_functions/.chezmoiremove new file mode 100644 index 0000000..c3a2550 --- /dev/null +++ b/dot_config/fish/private_functions/.chezmoiremove @@ -0,0 +1,2 @@ +kdjango.fish + diff --git a/dot_config/fish/private_functions/private_kdjango.fish b/dot_config/fish/private_functions/private_kdjango.fish deleted file mode 100644 index f6c2855..0000000 --- a/dot_config/fish/private_functions/private_kdjango.fish +++ /dev/null @@ -1,37 +0,0 @@ -# Defined interactively -function kdjango --description 'Pop into the shell of django pod of the current namespace' - argparse -X 1 -x "h,b,s,m,o,d" "h/help" "b/bash" "s/sh" "m/manage" "o/original-shell" "d/db-shell" -- $argv; or return - if set -q _flag_h - echo "Exec into the django pod of the current namespace..." - echo -e "kdjango [-b]\t ...using bash (default if no option)" - echo -e "kdjango -s\t ...using sh" - echo -e "kdjango -m\t ...using manage.py shell_plus" - echo -e "kdjango -o\t ...using manage.py shell" - echo -e "kdjango -d\t ...using manage.py dbshell" - echo -e "\nRequires kubens for namespace selection" - return - end - if count $argv > /dev/null - set pod $argv[1] - else - set pod (kubectl get pods -o name | grep "django" | grep -Ev "celery|migrations" | head -1) - end - set -l command /bin/bash - if set -q _flag_b - set command /bin/bash - else if set -q _flag_s - set command /bin/sh - else if set -q _flag_m - set command ./manage.py shell_plus - else if set -q _flag_o - set command ./manage.py shell - else if set -q _flag_d - if kubectl exec -it $pod -- which pgcli &> /dev/null - set command sh -c 'pgcli $(./manage.py sqldsn --quiet --style=uri)' - else - set command ./manage.py dbshell - end - end - echo "running $command in $pod" - kubectl exec -it $pod -- $command -end