Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions internal/store/access_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ func (s *Store) AccessLogsByHostname(groupID, hostname string, opts *AccessLogOp
if opts != nil {
if opts.Start != "" {
startTime, _ := strconv.ParseInt(opts.Start, 10, 64)
result.Start(startTime)
result = result.Start(startTime)
Copy link
Collaborator

@blva blva Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[q] could we extend some of our e2e tests to cover this custom configuration? (start/end time)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intend to open a separate ticket to prioritize this bug fix since I think an expansion of the e2e tests will require some additional logic to modify a cluster on the data plane to populate the logs before running accesslogs list.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
if opts.End != "" {
endTime, _ := strconv.ParseInt(opts.End, 10, 64)
result.End(endTime)
result = result.End(endTime)
}

if opts.NLogs > 0 {
result.NLogs(opts.NLogs)
result = result.NLogs(opts.NLogs)
}

if opts.IPAddress != "" {
result.IpAddress(opts.IPAddress)
result = result.IpAddress(opts.IPAddress)
}

if opts.AuthResult != nil {
result.AuthResult(*opts.AuthResult)
result = result.AuthResult(*opts.AuthResult)
}
}

Expand All @@ -66,23 +66,23 @@ func (s *Store) AccessLogsByClusterName(groupID, clusterName string, opts *Acces
if opts != nil {
if opts.Start != "" {
startTime, _ := strconv.ParseInt(opts.Start, 10, 64)
result.Start(startTime)
result = result.Start(startTime)
}
if opts.End != "" {
endTime, _ := strconv.ParseInt(opts.End, 10, 64)
result.End(endTime)
result = result.End(endTime)
}

if opts.NLogs > 0 {
result.NLogs(opts.NLogs)
result = result.NLogs(opts.NLogs)
}

if opts.IPAddress != "" {
result.IpAddress(opts.IPAddress)
result = result.IpAddress(opts.IPAddress)
}

if opts.AuthResult != nil {
result.AuthResult(*opts.AuthResult)
result = result.AuthResult(*opts.AuthResult)
}
}
res, _, err := result.Execute()
Expand Down
Loading