diff --git a/go.mod b/go.mod index c4cb43eb4..f0398d1cc 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( kmodules.xyz/client-go v0.29.13 kmodules.xyz/crd-schema-fuzz v0.29.1 kmodules.xyz/go-containerregistry v0.0.12 - kmodules.xyz/resource-metrics v0.29.4 + kmodules.xyz/resource-metrics v0.29.5 kmodules.xyz/schema-checker v0.4.1 sigs.k8s.io/cli-utils v0.34.0 sigs.k8s.io/controller-runtime v0.17.2 diff --git a/go.sum b/go.sum index f0e78c651..9a0f3609d 100644 --- a/go.sum +++ b/go.sum @@ -322,8 +322,8 @@ kmodules.xyz/go-containerregistry v0.0.12 h1:Tl32QGmSqRVm9PUEb/f3dgDeu9zW5fVzt3q kmodules.xyz/go-containerregistry v0.0.12/go.mod h1:KgeNg0hDsgeda+qc0NzWk0iVRdF0+ZIg/oRzGoYh78I= kmodules.xyz/offshoot-api v0.29.0 h1:GHLhxxT9jU1N8+FvOCCeJNyU5g0duYS46UGrs6AHNLY= kmodules.xyz/offshoot-api v0.29.0/go.mod h1:5NxhBblXoDHWStx9HCDJR2KFTwYjEZ7i1Id3jelIunw= -kmodules.xyz/resource-metrics v0.29.4 h1:4RmTzmPdlPK2cVCSBC7BVUerXSV//NKMtwZefdU8UW0= -kmodules.xyz/resource-metrics v0.29.4/go.mod h1:OuG/QobZ7o8GFHl/u3lqaUR0fDZDegxtV8Vdh+MNBD4= +kmodules.xyz/resource-metrics v0.29.5 h1:ciuvRXuXsloLNW/JwkubqbYySsvHvHr6/nhkTL5Sf1o= +kmodules.xyz/resource-metrics v0.29.5/go.mod h1:OuG/QobZ7o8GFHl/u3lqaUR0fDZDegxtV8Vdh+MNBD4= kmodules.xyz/schema-checker v0.4.1 h1:V5UEjR6UMAXf307lTgw+9rDRfHLTNA8g/q9DngqYI9M= kmodules.xyz/schema-checker v0.4.1/go.mod h1:BRXLB3Osuc9raHRJxHOgZFGecZ2aZumLXCHAOa5NPdA= sigs.k8s.io/cli-utils v0.34.0 h1:zCUitt54f0/MYj/ajVFnG6XSXMhpZ72O/3RewIchW8w= diff --git a/vendor/kmodules.xyz/resource-metrics/api/utils.go b/vendor/kmodules.xyz/resource-metrics/api/utils.go index e1690b4aa..7af406acf 100644 --- a/vendor/kmodules.xyz/resource-metrics/api/utils.go +++ b/vendor/kmodules.xyz/resource-metrics/api/utils.go @@ -357,6 +357,9 @@ func AppNodeResourcesV2( } dbContainer := GetContainerByName(node.PodTemplate.Spec.Containers, containerName) + if dbContainer == nil { + return nil, 0, fmt.Errorf("failed to find container %s in pod template", containerName) + } rr := fn(dbContainer.Resources) sr := fn(ToResourceRequirements(node.Storage.Resources)) rr[core.ResourceStorage] = *sr.Storage() diff --git a/vendor/modules.txt b/vendor/modules.txt index c4d67f8f9..715b1095a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -720,7 +720,7 @@ kmodules.xyz/go-containerregistry/name ## explicit; go 1.21.5 kmodules.xyz/offshoot-api/api/v1 kmodules.xyz/offshoot-api/api/v2 -# kmodules.xyz/resource-metrics v0.29.4 +# kmodules.xyz/resource-metrics v0.29.5 ## explicit; go 1.21.5 kmodules.xyz/resource-metrics kmodules.xyz/resource-metrics/api