Skip to content

Instantly share code, notes, and snippets.

@rthallisey
Created April 25, 2019 15:13
Show Gist options
  • Save rthallisey/1e250f90bae891db10e0790952d67199 to your computer and use it in GitHub Desktop.
Save rthallisey/1e250f90bae891db10e0790952d67199 to your computer and use it in GitHub Desktop.
# Ask rbean@redhat.com for granting access
# to redhat-operators-stage
QUAY_USERNAME="USERNAME"
QUAY_PASSWORD="PASSWORD"
TOKEN=$(curl -sH "Content-Type: application/json" -XPOST https://quay.io/cnr/api/v1/users/login -d '
{
"user": {
"username": "'"${QUAY_USERNAME}"'",
"password": "'"${QUAY_PASSWORD}"'"
}
}' | jq -r '.token')
cat <<EOF | oc create -f -
apiVersion: operators.coreos.com/v1
kind: OperatorSource
metadata:
name: redhat-operators-stage
namespace: openshift-marketplace
spec:
type: appregistry
endpoint: https://quay.io/redhat-operators-stage
registryNamespace: redhat-operators-stage
displayName: "RedHat Operators Stage"
publisher: "Red Hat"
EOF
cat <<EOF | oc create -f -
apiVersion: v1
kind: Secret
metadata:
name: downstream-quay
namespace: openshift-marketplace
type: Opaque
stringData:
token: $TOKEN
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment