Skip to content

Instantly share code, notes, and snippets.

@jupierce
Created April 11, 2018 18:08
Show Gist options
  • Select an option

  • Save jupierce/c4dc77bf5e2149cd3e8b7f8a6e246ecd to your computer and use it in GitHub Desktop.

Select an option

Save jupierce/c4dc77bf5e2149cd3e8b7f8a6e246ecd to your computer and use it in GitHub Desktop.
#!/bin/bash
set -o xtrace
# CERT_FILE=./registry.apps.abutcher.com.crt KEY_FILE=./registry.apps.abutcher.com.key CA_FILE=./ca-chain.cert.pem ./regcerts.sh
DEST_CA="$(awk '{printf "%s\\n", $0}' /etc/origin/master/ca.crt)"
CERTIFICATE="$(awk '{printf "%s\\n", $0}' ${CERT_FILE})"
KEY="$(awk '{printf "%s\\n", $0}' ${KEY_FILE})"
CABUNDLE="$(awk '{printf "%s\\n", $0}' ${CA_FILE})"
oc patch route/docker-registry -p '{"spec":{"tls":{"certificate":"'"${CERTIFICATE}"'","key":"'"${KEY}"'","caCertificate":"'"${CABUNDLE}"'","destinationCACertificate":"'"${DEST_CA}"'"}}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment