Merge pull request #12102 from zhulongcheng/empty-op-log

fix(http): return an empty list of operation logs if not found
pull/12157/head
Chris Goller 2019-02-25 11:49:01 -06:00 committed by GitHub
commit 8a104eba28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -829,7 +829,7 @@ func newOrganizationLogResponse(id influxdb.ID, es []*influxdb.OperationLogEntry
}
return &operationLogResponse{
Links: map[string]string{
"self": fmt.Sprintf("/api/v2/organizations/%s/log", id),
"self": fmt.Sprintf("/api/v2/orgs/%s/log", id),
},
Log: log,
}

View File

@ -699,7 +699,7 @@ func (s *Service) GetBucketOperationLog(ctx context.Context, id influxdb.ID, opt
})
})
if err != nil {
if err != nil && err != errKeyValueLogBoundsNotFound {
return nil, 0, err
}

View File

@ -941,7 +941,7 @@ func (s *Service) GetDashboardOperationLog(ctx context.Context, id influxdb.ID,
})
})
if err != nil {
if err != nil && err != errKeyValueLogBoundsNotFound {
return nil, 0, err
}

View File

@ -493,7 +493,7 @@ func (s *Service) GetOrganizationOperationLog(ctx context.Context, id influxdb.I
})
})
if err != nil {
if err != nil && err != errKeyValueLogBoundsNotFound {
return nil, 0, err
}

View File

@ -451,7 +451,7 @@ func (s *Service) GetUserOperationLog(ctx context.Context, id influxdb.ID, opts
log := []*influxdb.OperationLogEntry{}
err := s.kv.View(func(tx Tx) error {
key, err := encodeBucketOperationLogKey(id)
key, err := encodeUserOperationLogKey(id)
if err != nil {
return err
}
@ -469,7 +469,7 @@ func (s *Service) GetUserOperationLog(ctx context.Context, id influxdb.ID, opts
})
})
if err != nil {
if err != nil && err != errKeyValueLogBoundsNotFound {
return nil, 0, err
}