Various Kubernetes-related scenarios to use as kubectl plug-ins.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

27 lines
1.0 KiB

#!/usr/bin/env bash
#
# Copyright (C) 2020, Maxim Lihachev, <envrm@yandex.ru>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##
## kubectl-ingress is a wrapper for 'kubectl get ingress` command which
## makes links clickable.
##
echo -e "$(sed 's!(([[:alpha:]](-?[[:alnum:]])*)\.)+[[:alpha:]]{2,}!\\e]8;;http://\0\\e\\\\\0\\e]8;;\\e\\!g;
s!((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])!\\e]8;;http://\0\\e\\\\\0\\e]8;;\\e\\!g
' -r <<<"$(kubectl get ingress "$@")")"