Skip to content

Commit

Permalink
Issue 357: Addressing review comments
Browse files Browse the repository at this point in the history
Signed-off-by: SrishT <[email protected]>
  • Loading branch information
SrishT authored and SrishT committed Aug 5, 2021
1 parent e56244a commit 0cd62bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/util/pravegacluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func HealthcheckCommand(version string, port int32, restport int32) []string {
if IsVersionBelow(version, compareVersion) {
command = fmt.Sprintf("netstat -ltn 2> /dev/null | grep %d || ss -ltn 2> /dev/null | grep %d", port, port)
} else {
command = fmt.Sprintf("curl -s -X GET 'http://localhost:%d/v1/health/liveness'", restport)
command = fmt.Sprintf("(netstat -ltn 2> /dev/null | grep %d || ss -ltn 2> /dev/null | grep %d) && (curl -s -X GET 'http://localhost:%d/v1/health/liveness' || curl -s -k -X GET 'https://localhost:%d/v1/health/liveness')", port, port, restport, restport)
}
return []string{"/bin/sh", "-c", command}
}
Expand Down Expand Up @@ -106,7 +106,7 @@ func ControllerReadinessCheck(version string, port int32, authflag bool) []strin
command = fmt.Sprintf("echo $JAVA_OPTS | grep 'controller.auth.tlsEnabled=true' && curl -s -X GET 'https://localhost:%d/v1/scopes/' -H 'accept: application/json' | grep '_system'|| (echo $JAVA_OPTS | grep 'controller.auth.tlsEnabled=false' && curl -s -X GET 'http://localhost:%d/v1/scopes/' -H 'accept: application/json' | grep '_system' ) || (echo $JAVA_OPTS | grep 'controller.security.tls.enable=true' && echo $JAVA_OPTS | grep -v 'controller.auth.tlsEnabled' && curl -s -X GET 'https://localhost:%d/v1/scopes/' -H 'accept: application/json' | grep '_system' ) || (curl -s -X GET 'http://localhost:%d/v1/scopes/' -H 'accept: application/json' | grep '_system') ", port, port, port, port)
}
} else {
command = fmt.Sprintf("curl -s -X GET 'http://localhost:%d/v1/health/readiness'", port)
command = fmt.Sprintf("curl -s -X GET 'http://localhost:%d/v1/health/readiness' || curl -s -k -X GET 'https://localhost:%d/v1/health/readiness'", port, port)
}
return []string{"/bin/sh", "-c", command}
}
Expand All @@ -116,7 +116,7 @@ func SegmentStoreReadinessCheck(version string, port int32, restport int32) []st
if IsVersionBelow(version, compareVersion) {
command = fmt.Sprintf("netstat -ltn 2> /dev/null | grep %d || ss -ltn 2> /dev/null | grep %d", port, port)
} else {
command = fmt.Sprintf("curl -s -X GET 'http://localhost:%d/v1/health/readiness'", restport)
command = fmt.Sprintf("curl -s -X GET 'http://localhost:%d/v1/health/readiness' || curl -s -k -X GET 'https://localhost:%d/v1/health/readiness'", restport, restport)
}
return []string{"/bin/sh", "-c", command}
}
Expand Down

0 comments on commit 0cd62bb

Please sign in to comment.