mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #88022 from YangLu1031/master
Dump docker image list
This commit is contained in:
commit
4065a5a236
@ -218,6 +218,25 @@ function export-windows-docker-event-log() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Saves prepulled Windows Docker images list to ${WINDOWS_LOGS_DIR}\docker_images.log
|
||||||
|
# on node $1.
|
||||||
|
function export-windows-docker-images-list() {
|
||||||
|
local -r node="${1}"
|
||||||
|
|
||||||
|
local -r powershell_cmd="powershell.exe -Command \"\$logs=\$(docker image list); \$logs | Out-File -FilePath '${WINDOWS_LOGS_DIR}\\docker_images.log'\""
|
||||||
|
|
||||||
|
# Retry up to 3 times to allow ssh keys to be properly propagated and
|
||||||
|
# stored.
|
||||||
|
for retry in {1..3}; do
|
||||||
|
if gcloud compute ssh --project "${PROJECT}" --zone "${ZONE}" "${node}" \
|
||||||
|
--command "$powershell_cmd"; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
sleep 10
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# Saves log files from diagnostics tool.(https://github.com/GoogleCloudPlatform/compute-image-tools/tree/master/cli_tools/diagnostics)
|
# Saves log files from diagnostics tool.(https://github.com/GoogleCloudPlatform/compute-image-tools/tree/master/cli_tools/diagnostics)
|
||||||
function save-windows-logs-via-diagnostics-tool() {
|
function save-windows-logs-via-diagnostics-tool() {
|
||||||
local node="${1}"
|
local node="${1}"
|
||||||
@ -247,6 +266,7 @@ function save-windows-logs-via-ssh() {
|
|||||||
local dest_dir="${2}"
|
local dest_dir="${2}"
|
||||||
|
|
||||||
export-windows-docker-event-log "${node}"
|
export-windows-docker-event-log "${node}"
|
||||||
|
export-windows-docker-images-list "${node}"
|
||||||
|
|
||||||
local remote_files=()
|
local remote_files=()
|
||||||
for file in ${windows_node_logfiles[@]}; do
|
for file in ${windows_node_logfiles[@]}; do
|
||||||
|
Loading…
Reference in New Issue
Block a user