Skip to content

Instantly share code, notes, and snippets.

@stbenjam
Created August 29, 2019 14:56
Show Gist options
  • Save stbenjam/9305bb31db4c1754e3e84ddcd354ebbe to your computer and use it in GitHub Desktop.
Save stbenjam/9305bb31db4c1754e3e84ddcd354ebbe to your computer and use it in GitHub Desktop.
debug oc crash
#!/usr/bin/env bash
set -e
set -x
source $CONFIG
export GOTRACEBACK=crash
function get_core {
coredumpctl -o core.oc dump /usr/local/bin/oc
}
function clean {
rm -f "${pullsecret_file}"
rm -rf "${extract_dir}"
}
pullsecret_file=$(mktemp "oc-debug--XXXXXXXXXX")
extract_dir=$(mktemp -d "oc-debug--XXXXXXXXXX")
trap clean EXIT
trap get_core ERR
echo $PULL_SECRET > $pullsecret_file
for i in `seq 1 100`
do
echo "****** Trying to oc extract $i/100"
oc adm release extract --registry-config "$pullsecret_file" --command='openshift-baremetal-install' --to "${extract_dir}" registry.svc.ci.openshift.org/ocp/release:4.2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment