Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip "pods/" prefix from the pod names returned by kubectl get pods. #44674

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions federation/cluster/log-dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ function dump_federation_pod_logs() {
fi

kubectl logs "${pod_name}" --namespace="${FEDERATION_NAMESPACE}" \
>"${OUTPUT_DIR}/${pod_name#pod/}.log"
>"${OUTPUT_DIR}/${pod_name#pods/}.log"
done
}

# Dumps logs from all containers in an API server pod.
# Arguments:
# - the name of the API server pod, with a pod/ prefix.
# - the name of the API server pod, with a pods/ prefix.
function dump_apiserver_pod_logs() {
local -r apiserver_pod_containers=(apiserver etcd)
for container in ${apiserver_pod_containers[@]}; do
kubectl logs "${1}" -c "${container}" --namespace="${FEDERATION_NAMESPACE}" \
>"${OUTPUT_DIR}/${1#pod/}-${container}.log"
>"${OUTPUT_DIR}/${1#pods/}-${container}.log"
done
}

Expand All @@ -66,7 +66,7 @@ function dump_dns_pod_logs() {
# it has three containers.
for container in ${dns_pod_containers[@]}; do
kubectl logs "${pod_name}" -c "${container}" --namespace=kube-system \
>"${OUTPUT_DIR}/${pod_name#pod/}-${container}.log"
>"${OUTPUT_DIR}/${pod_name#pods/}-${container}.log"
done
done
}
Expand Down