dev: automated commit - 2025-11-05 07:47:00
This commit is contained in:
parent
fe1c04b281
commit
3723c80876
2 changed files with 8 additions and 8 deletions
|
|
@ -36,6 +36,6 @@ assign [app_id="firefox"] 2
|
||||||
assign [app_id="zen"] 2
|
assign [app_id="zen"] 2
|
||||||
assign [instance="vivaldi-stable"] 2
|
assign [instance="vivaldi-stable"] 2
|
||||||
assign [class="Vivaldi-stable"] 2
|
assign [class="Vivaldi-stable"] 2
|
||||||
assign [class="Slack"] 1
|
assign [app_id="Slack"] 1
|
||||||
assign [app_id="^Chromium"] 1
|
assign [app_id="^Chromium"] 1
|
||||||
assign [instance="obsidian"] 10
|
assign [instance="obsidian"] 10
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ function kf {
|
||||||
compdef _kf_completion kf 2>/dev/null
|
compdef _kf_completion kf 2>/dev/null
|
||||||
_kf_completion_setup=1
|
_kf_completion_setup=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
||||||
echo "Usage: kf <cluster> [service-name[:port]] [service-name[:port]] ..."
|
echo "Usage: kf <cluster> [service-name[:port]] [service-name[:port]] ..."
|
||||||
echo "Example: kf oc-dev-internal-eks-cluster oc-activate-web"
|
echo "Example: kf oc-dev-internal-eks-cluster oc-activate-web"
|
||||||
|
|
@ -31,7 +31,7 @@ function kf {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "🔌 Forwarding services (cluster: $cluster)"
|
echo "🔌 Forwarding services (cluster: $cluster)"
|
||||||
|
|
||||||
local existing_pids
|
local existing_pids
|
||||||
existing_pids=$(pgrep -f "kubectl.*port-forward" || true)
|
existing_pids=$(pgrep -f "kubectl.*port-forward" || true)
|
||||||
if [[ -n "$existing_pids" ]]; then
|
if [[ -n "$existing_pids" ]]; then
|
||||||
|
|
@ -42,7 +42,7 @@ function kf {
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local pids=()
|
local pids=()
|
||||||
|
|
||||||
for service_spec in "$@"; do
|
for service_spec in "$@"; do
|
||||||
|
|
@ -57,7 +57,7 @@ function kf {
|
||||||
|
|
||||||
local svc
|
local svc
|
||||||
svc=$(kubectl --context "$cluster" -n oc-app get svc -o name | grep "^service/$service_name$" || true)
|
svc=$(kubectl --context "$cluster" -n oc-app get svc -o name | grep "^service/$service_name$" || true)
|
||||||
|
|
||||||
if [[ -z "$svc" ]]; then
|
if [[ -z "$svc" ]]; then
|
||||||
echo "⚠️ Service '$service_name' not found in namespace 'oc-app' - skipping"
|
echo "⚠️ Service '$service_name' not found in namespace 'oc-app' - skipping"
|
||||||
echo " Available services:"
|
echo " Available services:"
|
||||||
|
|
@ -84,7 +84,7 @@ function kf {
|
||||||
else
|
else
|
||||||
echo "→ Forwarding $name on port $forward_port"
|
echo "→ Forwarding $name on port $forward_port"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kubectl --context "$cluster" -n oc-app port-forward "svc/$name" "$forward_port:$service_port" >/dev/null 2>&1 &
|
kubectl --context "$cluster" -n oc-app port-forward "svc/$name" "$forward_port:$service_port" >/dev/null 2>&1 &
|
||||||
local pid=$!
|
local pid=$!
|
||||||
|
|
||||||
|
|
@ -128,5 +128,5 @@ _rmq_passwd_completion() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Completion functions are set up when functions are first called
|
compdef _rmq_passwd_completion rmq-passwd
|
||||||
# rmq-passwd completion will be set up if/when that function is defined elsewhere
|
compdef _kf_completion kf
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue