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 Abhishek Dosi
parent 214541b75b
commit 8c43deaa7a
2 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,10 @@
RESTAPI_ARGS=""
while true
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
certs=`sonic-cfggen -d -v "RESTAPI['certs']"`
allow_insecure=`sonic-cfggen -d -v "RESTAPI['config']['allow_insecure']"`

View File

@ -18,7 +18,6 @@ endif
$(DOCKER_RESTAPI)_CONTAINER_NAME = restapi
$(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 /etc/sonic/certificates:/etc/sonic/certificates:ro
$(DOCKER_RESTAPI)_RUN_OPT += -p=8081:8081/tcp