[Fixes #373] Fixed envsubst not working on Ubuntu18.04/CentOS8 on VirtualBox #374
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind bug fix
What this PR does / why we need it:
This PR fixes the issue of dashboard not accessible on fresh installation on Ubuntu18.04 and CentOS8 on VirtualBox.
During the process of bringing up the docker container for dashboard the
entrypoint.sh
file is executed. As part of the initialisation the nginx configuration and environment variable substitution is performed.This environment variable substitution is performed using the following line: link here
envsubst '\${OPENSDS_S3_HOST} \${OPENSDS_S3_PORT}' < "/var/www/html/assets/data/runtime.json" > "/var/www/html/assets/data/runtime.json"
This code works on Ubuntu 16.04 and Ubuntu 18.04 when installing on a VM or a Laptop. But while installing on VirtualBox using Ubuntu18.04 or CentOS8 the above line does not execute.
The envsubst command is shipped with the
nginx:alpine
image on which the docker container for the dashboard is based and is the recommended way to replace environment variables at runtime.To solve this issue the line is replaced with the following line:
echo "{\"hostIP\": \"$OPENSDS_S3_HOST\",\"hostPort\": \"$OPENSDS_S3_PORT\"}" >/var/www/html/assets/data/runtime.json
Which issue(s) this PR fixes:
Fixes #373
Test Report Added?:
/kind TESTED
Test Report:
Special notes for your reviewer:
Tested on VirtualBox installation of Ubuntu18.04. Able to access the dashboard.