Skip to content

Instantly share code, notes, and snippets.

@stbenjam stbenjam/debug-oc.sh Secret
Created Aug 29, 2019

Embed
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`
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
You can’t perform that action at this time.