From 4aa64cec7298f7aac9e23bd7ad632e4f50801fc2 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 2 Oct 2024 14:48:30 -0300 Subject: [PATCH] check nil spec --- kontrol-service/topology/toplogy.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kontrol-service/topology/toplogy.go b/kontrol-service/topology/toplogy.go index 3647648..c589199 100644 --- a/kontrol-service/topology/toplogy.go +++ b/kontrol-service/topology/toplogy.go @@ -31,9 +31,9 @@ func ClusterTopology(clusterTopology *resolved.ClusterTopology, flowsClusterTopo label := key versions := lo.Map(services, func(service *resolved.Service, _ int) apiTypes.NodeVersion { var imageTag *string - containers := service.WorkloadSpec.GetTemplateSpec().Containers - if containers != nil && len(containers) > 0 { - imageTag = &containers[0].Image + podSpec := service.WorkloadSpec.GetTemplateSpec() + if podSpec != nil && len(podSpec.Containers) > 0 { + imageTag = &podSpec.Containers[0].Image } isBaseline := service.Version == clusterTopology.Namespace return apiTypes.NodeVersion{