Skip to content

Commit

Permalink
readinesscheck for only auth added (#426)
Browse files Browse the repository at this point in the history
Signed-off-by: prabhaker24 <[email protected]>

Co-authored-by: prabhaker24 <[email protected]>
  • Loading branch information
Prabhaker24 and prabhaker24 authored Jul 20, 2020
1 parent 19b6e2e commit bf5afd9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/util/pravegacluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ func HealthcheckCommand(port int32) []string {
}

func ControllerReadinessCheck(port int32, authflag bool, tlsflag bool) []string {
if authflag == true {
if authflag == true && tlsflag == true {
return []string{"/bin/sh", "-c", fmt.Sprintf("curl -v -k -u testtls:testtls -s -X GET 'https://localhost:%d/v1/scopes/' 2>&1 -H 'accept: application/json' | grep 401", port)}
}
if authflag == true {
return []string{"/bin/sh", "-c", fmt.Sprintf("curl -v -k -u testauth:testauth -s -X GET 'https://localhost:%d/v1/scopes/' 2>&1 -H 'accept: application/json' | grep 401", port)}
}
if tlsflag == true {
return []string{"/bin/sh", "-c", fmt.Sprintf("curl -v -k -s -X GET 'https://localhost:%d/v1/scopes/' 2>&1 -H 'accept: application/json' | grep '_system'", port)}
}

return []string{"/bin/sh", "-c", fmt.Sprintf("curl -s -X GET 'https://localhost:%d/v1/scopes/' -H 'accept: application/json' | grep '_system'", port)}
}

Expand Down

0 comments on commit bf5afd9

Please sign in to comment.