Skip to content

Instantly share code, notes, and snippets.

@dmc5179
Created November 12, 2020 02:49
Show Gist options
  • Save dmc5179/049c7c71c82041216459ae3a369cba0c to your computer and use it in GitHub Desktop.
Save dmc5179/049c7c71c82041216459ae3a369cba0c to your computer and use it in GitHub Desktop.
Clair export import
#!/bin/bash -x
QUAY_NAMESPACE='quay-enterprise'
CLAIR_POSTGRES_POD=$(oc get -n ${QUAY_NAMESPACE} pods | grep clair-postgres | awk -F\ '{print $1}')
echo "POD: ${CLAIR_POSTGRES_POD}"
oc rsh -n ${QUAY_NAMESPACE} ${CLAIR_POSTGRES_POD} /bin/sh -c "pg_dump -U postgres -a -t feature -t keyvalue -t namespace -t schema_migrations -t vulnerability -t vulnerability_fixedin_feature clair" > clair_vulnerability.sql
oc rsh -n ${QUAY_NAMESPACE} ${CLAIR_POSTGRES_POD} /bin/sh -c "pg_dump -U postgres -c -s clair" > clair_clear.sql
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment