Skip to content

Commit

Permalink
Set the Memcached server with an ENV variable rather than a file
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunne committed Jun 20, 2017
1 parent 91ad649 commit a1d6591
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 0 additions & 2 deletions images/miq-app/docker-assets/appliance-initialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ prepare_init_env
# Check Memcached readiness
check_svc_status ${MEMCACHED_SERVICE_NAME} 11211

setup_memcached

# Check DB readiness
check_svc_status ${DATABASE_SERVICE_NAME} 5432

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,6 @@ function init_appliance() {
[ "$?" -ne "0" ] && echo "ERROR: Failed to initialize appliance, please check journal or appliance_console logs at ${APP_ROOT}/log/appliance_console.log" && exit 1
}

# Replace memcached host in EVM configuration to use assigned service pod IP
function setup_memcached() {
echo "== Applying memcached config =="

sed -i~ -E "s/:memcache_server:.*/:memcache_server: ${MEMCACHED_SERVICE_NAME}:11211/gi" "${APP_ROOT}/config/settings.yml"

[ "$?" -eq "0" ] && return 0 || echo "ERROR: Failed to apply memcached configuration, please check journal or PV logs" && exit 1
}

# Run hook script to enable future code to be run anywhere needed (i.e upgrades)
function run_hook() {
echo "== Calling Deployment Hook =="
Expand Down
3 changes: 3 additions & 0 deletions templates/miq-template-ext-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ objects:
secretKeyRef:
name: "${NAME}-secrets"
key: "database-url"
-
name: "MEMCACHED_SERVER"
value: "${MEMCACHED_SERVICE_NAME}:11211"
-
name: "MEMCACHED_SERVICE_NAME"
value: "${MEMCACHED_SERVICE_NAME}"
Expand Down
3 changes: 3 additions & 0 deletions templates/miq-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ objects:
secretKeyRef:
name: "${NAME}-secrets"
key: "database-url"
-
name: "MEMCACHED_SERVER"
value: "${MEMCACHED_SERVICE_NAME}:11211"
-
name: "MEMCACHED_SERVICE_NAME"
value: "${MEMCACHED_SERVICE_NAME}"
Expand Down

0 comments on commit a1d6591

Please sign in to comment.