github.com/replicatedhq/ship@v0.55.0/integration/failing/init_app/helm-github/expected/installer/charts/minio-forked-proxy/configmap.yaml (about) 1 --- 2 # Source: minio/templates/configmap.yaml 3 apiVersion: v1 4 kind: ConfigMap 5 metadata: 6 name: integration-replicated-app-helm-github 7 labels: 8 app: minio 9 chart: minio-2.2.0 10 release: integration-replicated-app-helm-github 11 heritage: Tiller 12 data: 13 initialize: |- 14 #!/bin/sh 15 set -e ; # Have script exit in the event of a failed command. 16 17 # connectToMinio 18 # Use a check-sleep-check loop to wait for Minio service to be available 19 connectToMinio() { 20 ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts 21 set -e ; # fail if we can't read the keys. 22 ACCESS=$(cat /config/accesskey) ; SECRET=$(cat /config/secretkey) ; 23 set +e ; # The connections to minio are allowed to fail. 24 echo "Connecting to Minio server: http://$MINIO_ENDPOINT:$MINIO_PORT" ; 25 MC_COMMAND="mc config host add myminio http://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ; 26 $MC_COMMAND ; 27 STATUS=$? ; 28 until [ $STATUS = 0 ] 29 do 30 ATTEMPTS=`expr $ATTEMPTS + 1` ; 31 echo \"Failed attempts: $ATTEMPTS\" ; 32 if [ $ATTEMPTS -gt $LIMIT ]; then 33 exit 1 ; 34 fi ; 35 sleep 2 ; # 1 second intervals between attempts 36 $MC_COMMAND ; 37 STATUS=$? ; 38 done ; 39 set -e ; # reset `e` as active 40 return 0 41 } 42 43 # checkBucketExists ($bucket) 44 # Check if the bucket exists, by using the exit code of `mc ls` 45 checkBucketExists() { 46 BUCKET=$1 47 CMD=$(/usr/bin/mc ls myminio/$BUCKET > /dev/null 2>&1) 48 return $? 49 } 50 51 # createBucket ($bucket, $policy, $purge) 52 # Ensure bucket exists, purging if asked to 53 createBucket() { 54 BUCKET=$1 55 POLICY=$2 56 PURGE=$3 57 58 # Purge the bucket, if set & exists 59 # Since PURGE is user input, check explicitly for `true` 60 if [ $PURGE = true ]; then 61 if checkBucketExists $BUCKET ; then 62 echo "Purging bucket '$BUCKET'." 63 set +e ; # don't exit if this fails 64 /usr/bin/mc rm -r --force myminio/$BUCKET 65 set -e ; # reset `e` as active 66 else 67 echo "Bucket '$BUCKET' does not exist, skipping purge." 68 fi 69 fi 70 71 # Create the bucket if it does not exist 72 if ! checkBucketExists $BUCKET ; then 73 echo "Creating bucket '$BUCKET'" 74 /usr/bin/mc mb myminio/$BUCKET 75 else 76 echo "Bucket '$BUCKET' already exists." 77 fi 78 79 # At this point, the bucket should exist, skip checking for existence 80 # Set policy on the bucket 81 echo "Setting policy of bucket '$BUCKET' to '$POLICY'." 82 /usr/bin/mc policy $POLICY myminio/$BUCKET 83 } 84 85 # Try connecting to Minio instance 86 connectToMinio 87 # Create the bucket 88 createBucket bucket none false 89 90 config.json: |- 91 { 92 "version": "26", 93 "credential": { 94 "accessKey": "AKIAIOSFODNN7EXAMPLE", 95 "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" 96 }, 97 "region": "us-east-1", 98 "worm": "off", 99 "storageclass": { 100 "standard": "", 101 "rrs": "" 102 }, 103 "cache": { 104 "drives": [], 105 "expiry": 90, 106 "maxuse": 80, 107 "exclude": [] 108 }, 109 "notify": { 110 "amqp": { 111 "1": { 112 "enable": false, 113 "url": "", 114 "exchange": "", 115 "routingKey": "", 116 "exchangeType": "", 117 "deliveryMode": 0, 118 "mandatory": false, 119 "immediate": false, 120 "durable": false, 121 "internal": false, 122 "noWait": false, 123 "autoDeleted": false 124 } 125 }, 126 "nats": { 127 "1": { 128 "enable": false, 129 "address": "", 130 "subject": "", 131 "username": "", 132 "password": "", 133 "token": "", 134 "secure": false, 135 "pingInterval": 0, 136 "streaming": { 137 "enable": false, 138 "clusterID": "", 139 "clientID": "", 140 "async": false, 141 "maxPubAcksInflight": 0 142 } 143 } 144 }, 145 "elasticsearch": { 146 "1": { 147 "enable": false, 148 "format": "namespace", 149 "url": "", 150 "index": "" 151 } 152 }, 153 "redis": { 154 "1": { 155 "enable": false, 156 "format": "namespace", 157 "address": "", 158 "password": "", 159 "key": "" 160 } 161 }, 162 "postgresql": { 163 "1": { 164 "enable": false, 165 "format": "namespace", 166 "connectionString": "", 167 "table": "", 168 "host": "", 169 "port": "", 170 "user": "", 171 "password": "", 172 "database": "" 173 } 174 }, 175 "kafka": { 176 "1": { 177 "enable": false, 178 "brokers": null, 179 "topic": "" 180 } 181 }, 182 "webhook": { 183 "1": { 184 "enable": false, 185 "endpoint": "" 186 } 187 }, 188 "mysql": { 189 "1": { 190 "enable": false, 191 "format": "namespace", 192 "dsnString": "", 193 "table": "", 194 "host": "", 195 "port": "", 196 "user": "", 197 "password": "", 198 "database": "" 199 } 200 }, 201 "mqtt": { 202 "1": { 203 "enable": false, 204 "broker": "", 205 "topic": "", 206 "qos": 0, 207 "clientId": "", 208 "username": "", 209 "password": "", 210 "reconnectInterval": 0, 211 "keepAliveInterval": 0 212 } 213 } 214 } 215 }