• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

KusionStack / karpor / 43066903481
66%
main: 66%

Build:
Build:
LAST BUILD BRANCH: fix/pod-log-query-validation
DEFAULT BRANCH: main
Ran 11 Nov 2026 05:19PM UTC
Jobs 1
Files 68
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Nov 2026 05:18PM UTC coverage: 66.053% (-0.03%) from 66.082%
43066903481

Pull #880

github

NopeCharon
fix(insight): reject invalid pod log filters instead of ignoring them

The pod log endpoint parsed the since, sinceTime and tailLines query
parameters but dropped any value it could not parse, then streamed the
logs as if no filter had been set. The log settings dialog makes this
easy to hit: its "Show logs since" field suggests "e.g. 1h, 2d", but
time.ParseDuration has no day unit, so entering "2d" silently returned
the last 1000 lines instead of the last two days.

Move the query parsing into buildPodLogOptions and make it return an
error for:

- a since value that is not a positive Go duration (for example "2d",
  "0s" or "-5m"). Sub-second durations are rounded up to 1s, because
  the Kubernetes API rejects sinceSeconds=0;
- a sinceTime value that is not an RFC3339 timestamp;
- a tailLines value that is not a non-negative integer.

GetPodLogs sends the error through the existing SSE error entry, which
the log viewer already shows as an alert, and does so before building
the cluster client. Valid requests produce the same PodLogOptions as
before.

The placeholder of the since field now shows supported values
("e.g. 5m, 1h, 48h"), matching the units accepted by kubectl logs
--since and the API docs of the endpoint.

Add table-driven tests for buildPodLogOptions covering the defaults for
streaming and download, valid and invalid since, sinceTime and
tailLines values, and since taking precedence over sinceTime.

Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
Pull Request #880: fix(insight): reject invalid pod log filters instead of ignoring them

4553 of 6893 relevant lines covered (66.05%)

0.73 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
57.4
-0.9% pkg/syncer/single_cluster_sync_manager.go
Jobs
ID Job ID Ran Files Coverage
1 43066903481.1 11 Nov 2026 05:19PM UTC 68
66.05
GitHub Action Run
Source Files on build 43066903481
  • Tree
  • List 68
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #880
  • PR Base - main (#42742650943)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc