Fix docker restapi start issue, undefined error (#4475)

This commit is contained in:
Prince Sunny 2020-04-24 12:43:56 -07:00 committed by GitHub
parent 057ced0391
commit 4adf243260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,10 @@
RESTAPI_ARGS="" RESTAPI_ARGS=""
while true while true
do do
client_auth=`sonic-cfggen -d -v "RESTAPI['config']['client_auth']"` has_client_auth=$(sonic-cfggen -d -v "1 if RESTAPI and RESTAPI['config']")
if [ "$has_client_auth" == "1" ]; then
client_auth=$(sonic-cfggen -d -v "RESTAPI['config']['client_auth']")
fi
if [[ $client_auth == 'true' ]]; then if [[ $client_auth == 'true' ]]; then
certs=`sonic-cfggen -d -v "RESTAPI['certs']"` certs=`sonic-cfggen -d -v "RESTAPI['certs']"`
allow_insecure=`sonic-cfggen -d -v "RESTAPI['config']['allow_insecure']"` allow_insecure=`sonic-cfggen -d -v "RESTAPI['config']['allow_insecure']"`

View File

@ -18,7 +18,6 @@ endif
$(DOCKER_RESTAPI)_CONTAINER_NAME = restapi $(DOCKER_RESTAPI)_CONTAINER_NAME = restapi
$(DOCKER_RESTAPI)_RUN_OPT += --cap-add NET_ADMIN --privileged -t $(DOCKER_RESTAPI)_RUN_OPT += --cap-add NET_ADMIN --privileged -t
$(DOCKER_RESTAPI)_RUN_OPT += --network="host"
$(DOCKER_RESTAPI)_RUN_OPT += -v /var/run/redis/redis.sock:/var/run/redis/redis.sock $(DOCKER_RESTAPI)_RUN_OPT += -v /var/run/redis/redis.sock:/var/run/redis/redis.sock
$(DOCKER_RESTAPI)_RUN_OPT += -v /etc/sonic/certificates:/etc/sonic/certificates:ro $(DOCKER_RESTAPI)_RUN_OPT += -v /etc/sonic/certificates:/etc/sonic/certificates:ro
$(DOCKER_RESTAPI)_RUN_OPT += -p=8081:8081/tcp $(DOCKER_RESTAPI)_RUN_OPT += -p=8081:8081/tcp