From fc158ac27b8b97423387c9fcb12ff7b779ad432a Mon Sep 17 00:00:00 2001 From: Vincent de Phily Date: Wed, 8 Jul 2026 17:13:21 +0100 Subject: [PATCH] Fix iterating over stream.Status.Tags It's an `[]T`, not a `map[string]T`, tag string is in `T.Tag`. Only affects log output. Mistake was AFAICT here from the start, but only showed up a typecheck error with go 1.26. --- pkg/cli/admin/top/graph.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/cli/admin/top/graph.go b/pkg/cli/admin/top/graph.go index 5ff9ceafb9..671f929a84 100644 --- a/pkg/cli/admin/top/graph.go +++ b/pkg/cli/admin/top/graph.go @@ -68,13 +68,12 @@ func addImageStreamsToGraph(g genericgraph.Graph, streams *imagev1.ImageStreamLi imageStreamNode := isNode.(*imagegraph.ImageStreamNode) // connect IS with underlying images - for tag, history := range stream.Status.Tags { - for i := range history.Items { - image := history.Items[i] + for _, history := range stream.Status.Tags { + for i, image := range history.Items { imageNode := imagegraph.FindImage(g, image.Image) if imageNode == nil { klog.V(2).Infof("Unable to find image %q in graph (from tag=%q, dockerImageReference=%s)", - history.Items[i].Image, tag, image.DockerImageReference) + history.Items[i].Image, history.Tag, image.DockerImageReference) continue } klog.V(4).Infof("Adding edge from %q to %q", imageStreamNode.UniqueName(), imageNode.UniqueName())