From 6f74dea8ed0499b351b10fdb5efc5624a96eb816 Mon Sep 17 00:00:00 2001 From: christophe-duc Date: Wed, 7 Jan 2026 20:28:20 -0400 Subject: [PATCH] fixed one more from copilot --- pkg/commands/container_stats.go | 3 +++ pkg/commands/pod.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkg/commands/container_stats.go b/pkg/commands/container_stats.go index 419782dd..f011194f 100644 --- a/pkg/commands/container_stats.go +++ b/pkg/commands/container_stats.go @@ -175,6 +175,9 @@ func (c *Container) eraseOldHistory(maxDuration time.Duration) { return } } + + // All entries are older than maxDuration, clear the history + c.StatHistory = nil } func (c *Container) GetLastStats() (*RecordedStats, bool) { diff --git a/pkg/commands/pod.go b/pkg/commands/pod.go index 909e9ec7..92928c8c 100644 --- a/pkg/commands/pod.go +++ b/pkg/commands/pod.go @@ -69,6 +69,9 @@ func (p *Pod) eraseOldHistory(maxDuration time.Duration) { return } } + + // All entries are older than maxDuration, clear the history + p.StatHistory = nil } // GetLastStats returns the most recent stats entry.