mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
dump docker image list
This commit is contained in:
parent
38acec9bbc
commit
c27fb4bad6
@ -218,6 +218,25 @@ function export-windows-docker-event-log() {
|
||||
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)
|
||||
function save-windows-logs-via-diagnostics-tool() {
|
||||
local node="${1}"
|
||||
@ -247,6 +266,7 @@ function save-windows-logs-via-ssh() {
|
||||
local dest_dir="${2}"
|
||||
|
||||
export-windows-docker-event-log "${node}"
|
||||
export-windows-docker-images-list "${node}"
|
||||
|
||||
local remote_files=()
|
||||
for file in ${windows_node_logfiles[@]}; do
|
||||
|
Loading…
Reference in New Issue
Block a user