From 99237607bf73e97b06eeb3455aa1327bfab4d5d2 Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Fri, 14 Sep 2018 11:46:59 -0400 Subject: [PATCH] YARN-8706. Allow additional flag in docker inspect call. Contributed by Chandni Singh --- .../main/native/container-executor/impl/utils/docker-util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/utils/docker-util.c b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/utils/docker-util.c index 3884abf9de..ee80798e77 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/utils/docker-util.c +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/utils/docker-util.c @@ -558,7 +558,8 @@ cleanup: int get_docker_inspect_command(const char *command_file, const struct configuration *conf, args *args) { const char *valid_format_strings[] = { "{{.State.Status}}", - "{{range(.NetworkSettings.Networks)}}{{.IPAddress}},{{end}}{{.Config.Hostname}}" }; + "{{range(.NetworkSettings.Networks)}}{{.IPAddress}},{{end}}{{.Config.Hostname}}", + "{{.State.Status}},{{.Config.StopSignal}}"}; int ret = 0, i = 0, valid_format = 0; char *format = NULL, *container_name = NULL, *tmp_buffer = NULL; struct configuration command_config = {0, NULL}; @@ -578,7 +579,7 @@ int get_docker_inspect_command(const char *command_file, const struct configurat ret = INVALID_DOCKER_INSPECT_FORMAT; goto free_and_exit; } - for (i = 0; i < 2; ++i) { + for (i = 0; i < 3; ++i) { if (strcmp(format, valid_format_strings[i]) == 0) { valid_format = 1; break;