From bf5afd9ea37723ae90705f9f972feb76de84ccff Mon Sep 17 00:00:00 2001 From: Prabhaker24 <54395361+Prabhaker24@users.noreply.github.com> Date: Mon, 20 Jul 2020 09:05:03 +0530 Subject: [PATCH] readinesscheck for only auth added (#426) Signed-off-by: prabhaker24 Co-authored-by: prabhaker24 --- pkg/util/pravegacluster.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/util/pravegacluster.go b/pkg/util/pravegacluster.go index 7f70955ae..252a188ff 100644 --- a/pkg/util/pravegacluster.go +++ b/pkg/util/pravegacluster.go @@ -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 'http://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 'http://localhost:%d/v1/scopes/' -H 'accept: application/json' | grep '_system'", port)} }