From b92356b386849dcaedd5842b0f3a5e22c4505af9 Mon Sep 17 00:00:00 2001 From: eladlachmi <110764839+eladlachmi@users.noreply.github.com> Date: Tue, 19 Sep 2023 14:34:50 +0300 Subject: [PATCH] Support both HTTP and HTTPS schemes in esti lakectl doctor tests (#6619) --- .gitallowed | 1 + esti/golden/lakectl_doctor_wrong_endpoint.golden | 2 +- esti/golden/lakectl_doctor_wrong_endpoint_verbose.golden | 2 +- esti/lakectl_doctor_test.go | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitallowed b/.gitallowed index 50b018b1e53..163237e84da 100644 --- a/.gitallowed +++ b/.gitallowed @@ -2,5 +2,6 @@ AKIAIO5FODNN7EXAMPLE AKIAIOSFODNN3EXAMPLE AKIAIOSFODNN7EXAMPLE AKIAJVHTOKZWGCD2QQYQ +AKIAJZZZZZZZZZZZZZZQ wJalrXUtnFEMI/K3MDENG/bPxRfiCYEXAMPLEKEY wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY diff --git a/esti/golden/lakectl_doctor_wrong_endpoint.golden b/esti/golden/lakectl_doctor_wrong_endpoint.golden index 0edd58e9f07..d556b15d47d 100644 --- a/esti/golden/lakectl_doctor_wrong_endpoint.golden +++ b/esti/golden/lakectl_doctor_wrong_endpoint.golden @@ -1,3 +1,3 @@ It looks like endpoint url is wrong. -Suspicious URI format for server.endpoint_url: http://${HOST}/api/v11 +Suspicious URI format for server.endpoint_url: ${HOST}/api/v11 diff --git a/esti/golden/lakectl_doctor_wrong_endpoint_verbose.golden b/esti/golden/lakectl_doctor_wrong_endpoint_verbose.golden index ceee34e890d..47accb7696d 100644 --- a/esti/golden/lakectl_doctor_wrong_endpoint_verbose.golden +++ b/esti/golden/lakectl_doctor_wrong_endpoint_verbose.golden @@ -9,4 +9,4 @@ Couldn't find a problem with access key format. Trying to validate secret access key format. Couldn't find a problem with secret access key format. Trying to validate endpoint URL format. -Suspicious URI format for server.endpoint_url: http://${HOST}/api/v11 +Suspicious URI format for server.endpoint_url: ${HOST}/api/v11 diff --git a/esti/lakectl_doctor_test.go b/esti/lakectl_doctor_test.go index 38e13f8fc03..94f4416846f 100644 --- a/esti/lakectl_doctor_test.go +++ b/esti/lakectl_doctor_test.go @@ -1,6 +1,7 @@ package esti import ( + "fmt" "net/url" "testing" @@ -17,7 +18,7 @@ func TestLakectlDoctor(t *testing.T) { require.NoError(t, err) vars := map[string]string{ "LAKEFS_ENDPOINT": endPointURL, - "HOST": u.Host, + "HOST": fmt.Sprintf("%s://%s", u.Scheme, u.Host), } RunCmdAndVerifySuccessWithFile(t, LakectlWithParams(accessKeyID, secretAccessKey, endPointURL)+" doctor", false, "lakectl_doctor_ok", vars)