Fix klogs
This commit is contained in:
parent
f9ed5be670
commit
d16b8262c9
@ -138,24 +138,26 @@ in
|
||||
git-sync-remote = lib.mkDefault "git remote update origin --prune";
|
||||
|
||||
klogs = lib.mkDefault "${pkgs.writeShellScript "klogs" ''
|
||||
ctx="$1"
|
||||
namespace="$2"
|
||||
label="$3"
|
||||
echo=${pkgs.coreutils}/bin/echo
|
||||
ctx="$1"
|
||||
shift
|
||||
namespace="$1"
|
||||
shift
|
||||
label="$1"
|
||||
shift
|
||||
|
||||
if [[ "$ctx" == "" || "$namespace" == "" || "$label" == "" ]]; then
|
||||
echo "Usage: klogs context namespace label"
|
||||
echo "${"\n"}Contexts:"
|
||||
kubectl config get-contexts -o name | sed 's/^/\t/g'
|
||||
if [[ "$ctx" == "" || "$namespace" == "" || "$label" == "" ]]; then
|
||||
echo "Usage: klogs context namespace label"
|
||||
echo "${"\n"}Contexts:"
|
||||
kubectl config get-contexts -o name | sed 's/^/\t/g'
|
||||
|
||||
echo "Label examples:"
|
||||
echo "${"\t"}app.kubernetes.io/name=..."
|
||||
echo "${"\t"}eks.amazonaws.com/component=..."
|
||||
exit 1
|
||||
fi
|
||||
echo "Label examples:"
|
||||
echo "${"\t"}app.kubernetes.io/name=..."
|
||||
echo "${"\t"}eks.amazonaws.com/component=..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kubectl --context "$ctx" logs -f -n "$namespace" -l "$label"
|
||||
''}";
|
||||
kubectl --context "$ctx" logs -f -n "$namespace" -l "$label" $@
|
||||
''}";
|
||||
|
||||
nixfix = lib.mkDefault "nix fmt ./**/*.nix";
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user