Skip to content

Instantly share code, notes, and snippets.

Created Aug 29, 2019
What would you like to do?
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`
echo "****** Trying to oc extract $i/100"
oc adm release extract --registry-config "$pullsecret_file" --command='openshift-baremetal-install' --to "${extract_dir}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment