add support for additional prometheus labels for query (#1936)
This commit is contained in:
@@ -144,7 +144,7 @@ func GetAuditEntry(ctx context.Context) *audit.Entry {
|
||||
}
|
||||
r = &audit.Entry{
|
||||
Version: audit.Version,
|
||||
//DeploymentID: globalDeploymentID,
|
||||
// DeploymentID: globalDeploymentID,
|
||||
Time: time.Now().UTC(),
|
||||
}
|
||||
SetAuditEntry(ctx, r)
|
||||
|
||||
@@ -144,7 +144,7 @@ func uniqueEntries(paths []string) []string {
|
||||
// and GOROOT directories. Also append github.com/minio/minio
|
||||
// This is done to clean up the filename, when stack trace is
|
||||
// displayed when an errors happens.
|
||||
func Init(goPath string, goRoot string) {
|
||||
func Init(goPath, goRoot string) {
|
||||
var goPathList []string
|
||||
var goRootList []string
|
||||
var defaultgoPathList []string
|
||||
|
||||
@@ -59,7 +59,6 @@ func TestNewEntry(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestToEntry(t *testing.T) {
|
||||
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/v1/tenants?test=xyz", nil)
|
||||
req.Header.Set("Authorization", "xyz")
|
||||
req.Header.Set("ETag", "\"ABCDE\"")
|
||||
@@ -91,7 +90,6 @@ func TestToEntry(t *testing.T) {
|
||||
},
|
||||
postFunc: func() {
|
||||
os.Unsetenv("CONSOLE_OPERATOR_MODE")
|
||||
|
||||
},
|
||||
name: "constructs an audit entry from a http request",
|
||||
args: args{
|
||||
|
||||
@@ -105,8 +105,7 @@ func (h *Target) Init() error {
|
||||
xhttp.DrainBody(resp.Body)
|
||||
|
||||
if !acceptedResponseStatusCode(resp.StatusCode) {
|
||||
switch resp.StatusCode {
|
||||
case http.StatusForbidden:
|
||||
if resp.StatusCode == http.StatusForbidden {
|
||||
return fmt.Errorf("%s returned '%s', please check if your auth token is correctly set",
|
||||
h.config.Endpoint, resp.Status)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user