adoroszlai commented on code in PR #7393:
URL: https://github.com/apache/ozone/pull/7393#discussion_r1829134344


##########
hadoop-ozone/dist/src/main/compose/common/hadoop-test.sh:
##########
@@ -21,6 +21,12 @@ if [[ ${SECURITY_ENABLED} == "true" ]]; then
 fi
 export 
COMPOSE_FILE="${COMPOSE_FILE:-docker-compose.yaml}":../common/${extra_compose_file}
 
+# need temp variables because maven filtering replaces only one item per line
+hadoop2_version="${hadoop2.version}"
+hadoop_version="${hadoop.version}"
+
+: ${HADOOP_TEST_VERSIONS:="apache/hadoop:${hadoop2_version} 
flokkr/hadoop:3.1.2 apache/hadoop:${hadoop_version}"}

Review Comment:
   > without exporting the `HADOOP_TEST_VERSIONS` environment variable, will we 
be able to override it?
   
   `export` is required for passing it to other scripts.  Since 
`HADOOP_TEST_VERSIONS` is defined and used in the same script, we don't need to 
export it.
   
   It should be exported for override before invoking `acceptance.sh`:
   
   ```
   export HADOOP_TEST_VERSIONS=XYZ
   ./hadoop-ozone/dev-support/checks/acceptance.sh
   ```
   
   GitHub Actions workflows export variables set in `env`, see link in PR's 
test description.
   
   > What does the `:` do in the beginning of the line?
   
   `:` is a no-op command.
   
   ```
   $ help :
   :: :
       Null command.
       
       No effect; the command does nothing.
       
       Exit Status:
       Always succeeds.
   ```
   
   `${var:=...}` assigns default value if var is unset.  To prevent the shell 
from trying to execute the result of that assignment as a command, we combine 
the two.  So `: ${var:=default}` is an idiom to set the default value of a 
variable.
   
   ```bash
   $ unset cmd
   $ ${cmd:=file}
   Usage: file [-bcCdEhikLlNnprsSvzZ0] [--apple] [--extension] [--mime-encoding]
               [--mime-type] [-e <testname>] [-F <separator>]  [-f <namefile>]
               [-m <magicfiles>] [-P <parameter=value>] [--exclude-quiet]
               <file> ...
          file -C [-m <magicfiles>]
          file [--help]
   $ echo $cmd
   file
   
   $ unset cmd
   $ : ${cmd:=file}
   $ echo $cmd
   file
   ```



-- 
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]

Reply via email to