navinko opened a new pull request, #9930:
URL: https://github.com/apache/ozone/pull/9930
## What changes were proposed in this pull request?
This PR fixes an issue in the Ozone docker-compose templates where ${}
patterns inside Log4j configuration were interpreted by docker-compose as
environment variable substitutions.This change escapes the Log4j variable
expressions in the docker-compose templates so that they are preserved and
correctly interpreted by Log4j at runtime instead of being processed by
docker-compose.
As per docker doc:
https://github.com/docker/docs/blob/3c79e7c2ac175507a245f55602549e8cecc1b6e1/content/reference/compose-file/interpolation.md?plain=1#L38
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14805
## How was this patch tested?
CI : https://github.com/navinko/ozone/actions/runs/23108826668
#Before fix (Broken)
> % docker-compose up -d
WARN[0000] The "hostName" variable is not set. Defaulting to a blank string.
Invalid template: "${sys:hadoop.log.dir}/om-audit-${hostName}.log"
#After fix (Working)
> % docker-compose up -d
[+] Running 6/6
✔ Network ozone-om-ha_default Created
0.0s
✔ Container ozone-om-ha-scm-1 Started
0.6s
✔ Container ozone-om-ha-om2-1 Started
0.6s
✔ Container ozone-om-ha-om3-1 Started
0.6s
✔ Container ozone-om-ha-datanode-1 Started
0.6s
✔ Container ozone-om-ha-om1-1 Started
0.5s
nakumar@FQV6LJQVJC ozone-om-ha % docker-compose exec -it om1 bash
bash-5.1$ cd /var/log/hadoop
bash-5.1$ ls -lart
total 12
drwxr-xr-x 1 root root 4096 Feb 6 11:50 ..
-rw-r--r-- 1 hadoop hadoop 0 Mar 15 16:36 om-audit-96bc0c52e252.log
-rw-r--r-- 1 hadoop hadoop 0 Mar 15 16:36 om-sys-audit-96bc0c52e252.log
drwxrwxrwt 1 root root 4096 Mar 15 16:36 .
bash-5.1$
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]