You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "smolnar82 (via GitHub)" <gi...@apache.org> on 2024/03/21 10:43:18 UTC

[PR] KNOX-3024 - Fixed Java finding issues [knox]

smolnar82 opened a new pull request, #891:
URL: https://github.com/apache/knox/pull/891

   ## What changes were proposed in this pull request?
   
   I updated the existing login in `knox-functions.sh` to successfully check Java executables under `/usr` if no `JAVA_HOME` is set or Java is not available on the path.
   In addition to fixing the issue, I added an option to display the Java with the `--verbose` option (when using KnoxCLI, `--verbose true` should be used.
   
   ## How was this patch tested?
   
   Checked the updated scripts on [shellcheck.net](https://www.shellcheck.net/) and tested them manually:
   - `gateway.sh`
   ```
   $ bin/gateway.sh restart --verbose
   Found Java at /usr/local/opt/openjdk@8/bin/java
   Stopping Gateway with PID 12173 succeeded.
   Starting Gateway succeeded with PID 12346.
   
   $ bin/gateway.sh restart
   Stopping Gateway with PID 12346 succeeded.
   Starting Gateway succeeded with PID 12419.
   ```
   - `knoxcli.sh`
   ```
   $ bin/knoxcli.sh export-cert --type JKS --verbose true
   Found Java at /usr/local/opt/openjdk@8/bin/java
   Certificate gateway-identity has been successfully exported to: /Users/sandormolnar/test/knoxGateway/data/security/keystores/gateway-client-trust.jks
   
   $ bin/knoxcli.sh export-cert --type JKS
   Certificate gateway-identity has been successfully exported to: /Users/sandormolnar/test/knoxGateway/data/security/keystores/gateway-client-trust.jks
   ```
   - `ldap.sh`
   ```
   $ bin/ldap.sh start --verbose
   Found Java at /usr/local/opt/openjdk@8/bin/java
   Starting LDAP succeeded with PID 12531.
   
   $ bin/ldap.sh stop
   Stopping LDAP with PID 12531 succeeded.
   
   $ bin/ldap.sh start
   Starting LDAP succeeded with PID 12573.
   ```


-- 
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: dev-unsubscribe@knox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KNOX-3024 - Fixed Java finding issues [knox]

Posted by "moresandeep (via GitHub)" <gi...@apache.org>.
moresandeep commented on code in PR #891:
URL: https://github.com/apache/knox/pull/891#discussion_r1533895612


##########
gateway-release-common/home/bin/knox-functions.sh:
##########
@@ -50,6 +50,17 @@ DEFAULT_APP_STATUS_TEST_RETRY_SLEEP=2
 ##### common functions #####
 ############################
 
+function setVerbose() {

Review Comment:
   i see makes sense :) 



-- 
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: dev-unsubscribe@knox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KNOX-3024 - Fixed Java finding issues [knox]

Posted by "smolnar82 (via GitHub)" <gi...@apache.org>.
smolnar82 merged PR #891:
URL: https://github.com/apache/knox/pull/891


-- 
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: dev-unsubscribe@knox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KNOX-3024 - Fixed Java finding issues [knox]

Posted by "smolnar82 (via GitHub)" <gi...@apache.org>.
smolnar82 commented on code in PR #891:
URL: https://github.com/apache/knox/pull/891#discussion_r1533888556


##########
gateway-release-common/home/bin/knox-functions.sh:
##########
@@ -50,6 +50,17 @@ DEFAULT_APP_STATUS_TEST_RETRY_SLEEP=2
 ##### common functions #####
 ############################
 
+function setVerbose() {

Review Comment:
   KnoxCLI only supports `--verbose`, hence the long version only. Maybe later...



-- 
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: dev-unsubscribe@knox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KNOX-3024 - Fixed Java finding issues [knox]

Posted by "moresandeep (via GitHub)" <gi...@apache.org>.
moresandeep commented on code in PR #891:
URL: https://github.com/apache/knox/pull/891#discussion_r1533871582


##########
gateway-release-common/home/bin/knox-functions.sh:
##########
@@ -50,6 +50,17 @@ DEFAULT_APP_STATUS_TEST_RETRY_SLEEP=2
 ##### common functions #####
 ############################
 
+function setVerbose() {

Review Comment:
   nitpick: May be accommodate shortform as well `-v`



-- 
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: dev-unsubscribe@knox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org