Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
latest
v1.15.0
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ You can try Volcano by one of the following two ways.
Install Volcano on an existing Kubernetes cluster. This way is both available for x86_64 and arm64 architecture.

```
kubectl apply -f https://raw.githubusercontent.com/volcano-sh/volcano/master/installer/volcano-development.yaml
kubectl apply -f https://raw.githubusercontent.com/volcano-sh/volcano/release-1.15/installer/volcano-development.yaml
```

Enjoy! Volcano will create the following resources in `volcano-system` namespace.
Expand Down Expand Up @@ -183,6 +183,7 @@ Please follow the guide [Volcano Dashboard](https://github.com/volcano-sh/dashbo
| | Kubernetes 1.35 | Kubernetes 1.34 | Kubernetes 1.33 | Kubernetes 1.32 | Kubernetes 1.31 | Kubernetes 1.30 | Kubernetes 1.29 | Kubernetes 1.28 | Kubernetes 1.27 | Kubernetes 1.26 | Kubernetes 1.25 | Kubernetes 1.24 | Kubernetes 1.23 | Kubernetes 1.22 | Kubernetes 1.21 |
|-----------------------|-----------------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|
| Volcano HEAD (master) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - | - |
| Volcano v1.15 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - | - |
| Volcano v1.14 | - | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - | - |
| Volcano v1.13 | - | - | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - | - |
| Volcano v1.12 | - | - | - | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ require (
github.com/stretchr/testify v1.11.1
github.com/vishvananda/netlink v1.3.1
go.uber.org/automaxprocs v1.6.0
golang.org/x/crypto v0.49.0
golang.org/x/sys v0.42.0
golang.org/x/crypto v0.51.0
golang.org/x/sys v0.45.0
golang.org/x/time v0.15.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.35.3
Expand Down Expand Up @@ -187,13 +187,13 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.1 // indirect
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa
golang.org/x/mod v0.33.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/term v0.41.0 // indirect
golang.org/x/text v0.35.0 // indirect
golang.org/x/tools v0.42.0 // indirect
golang.org/x/term v0.43.0 // indirect
golang.org/x/text v0.37.0 // indirect
golang.org/x/tools v0.44.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260319201613-d00831a3d3e7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c // indirect
google.golang.org/grpc v1.79.3 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,15 @@ go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=
golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI=
golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8=
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa h1:Zt3DZoOFFYkKhDT3v7Lm9FDMEV06GpzjG2jrqW+QTE0=
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM=
golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All @@ -461,8 +461,8 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -490,16 +490,16 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU=
golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A=
golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand All @@ -509,8 +509,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c=
golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI=
golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM=
golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=
golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM=
Expand Down
2 changes: 1 addition & 1 deletion installer/helm/chart/volcano/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
description: A Helm chart for Volcano
name: volcano
version: "1.15.0"
appVersion: "0.1"
appVersion: "1.15.0"
icon: https://raw.githubusercontent.com/volcano-sh/charts/master/docs/images/volcano-logo.png
home: https://volcano.sh
sources:
Expand Down
2 changes: 1 addition & 1 deletion installer/helm/chart/volcano/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ basic:
image_pull_policy: "Always"
# Common image tag when a per-component tag below is unset or empty.
# Per-component keys override this only when set to a non-empty string.
image_tag_version: "latest"
image_tag_version: "v1.15.0"
controller_image_tag_version: ""
scheduler_image_tag_version: ""
agent_scheduler_image_tag_version: ""
Expand Down
4 changes: 2 additions & 2 deletions installer/volcano-agent-development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ spec:
type: File
initContainers:
- name: volcano-agent-init
image: docker.io/volcanosh/vc-agent:latest
image: docker.io/volcanosh/vc-agent:v1.15.0
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down Expand Up @@ -163,7 +163,7 @@ spec:
imagePullPolicy: Always
containers:
- name: volcano-agent
image: docker.io/volcanosh/vc-agent:latest
image: docker.io/volcanosh/vc-agent:v1.15.0
securityContext:
capabilities:
add:
Expand Down
2 changes: 1 addition & 1 deletion installer/volcano-agent-scheduler-development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: volcano-agent-scheduler
image: docker.io/volcanosh/vc-agent-scheduler:latest
image: docker.io/volcanosh/vc-agent-scheduler:v1.15.0
args:
- --logtostderr
- --scheduler-conf=/volcano.scheduler/agent-scheduler.conf
Expand Down
8 changes: 4 additions & 4 deletions installer/volcano-development-vap-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ spec:
- --port=8443
- -v=4
- 2>&1
image: docker.io/volcanosh/vc-webhook-manager:latest
image: docker.io/volcanosh/vc-webhook-manager:v1.15.0
imagePullPolicy: Always
name: admission
volumeMounts:
Expand Down Expand Up @@ -252,7 +252,7 @@ spec:
restartPolicy: Never
containers:
- name: main
image: docker.io/volcanosh/vc-webhook-manager:latest
image: docker.io/volcanosh/vc-webhook-manager:v1.15.0
imagePullPolicy: Always
command: ["./gen-admission-secret.sh", "--service", "volcano-admission-service", "--namespace",
"volcano-system", "--secret", "volcano-admission-secret"]
Expand Down Expand Up @@ -9072,7 +9072,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: volcano-controllers
image: docker.io/volcanosh/vc-controller-manager:latest
image: docker.io/volcanosh/vc-controller-manager:v1.15.0
args:
- --logtostderr
- --enable-healthz=true
Expand Down Expand Up @@ -9294,7 +9294,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: volcano-scheduler
image: docker.io/volcanosh/vc-scheduler:latest
image: docker.io/volcanosh/vc-scheduler:v1.15.0
args:
- --logtostderr
- --scheduler-conf=/volcano.scheduler/volcano-scheduler.conf
Expand Down
8 changes: 4 additions & 4 deletions installer/volcano-development-vap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ spec:
- --port=8443
- -v=4
- 2>&1
image: docker.io/volcanosh/vc-webhook-manager:latest
image: docker.io/volcanosh/vc-webhook-manager:v1.15.0
imagePullPolicy: Always
name: admission
volumeMounts:
Expand Down Expand Up @@ -252,7 +252,7 @@ spec:
restartPolicy: Never
containers:
- name: main
image: docker.io/volcanosh/vc-webhook-manager:latest
image: docker.io/volcanosh/vc-webhook-manager:v1.15.0
imagePullPolicy: Always
command: ["./gen-admission-secret.sh", "--service", "volcano-admission-service", "--namespace",
"volcano-system", "--secret", "volcano-admission-secret"]
Expand Down Expand Up @@ -9072,7 +9072,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: volcano-controllers
image: docker.io/volcanosh/vc-controller-manager:latest
image: docker.io/volcanosh/vc-controller-manager:v1.15.0
args:
- --logtostderr
- --enable-healthz=true
Expand Down Expand Up @@ -9294,7 +9294,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: volcano-scheduler
image: docker.io/volcanosh/vc-scheduler:latest
image: docker.io/volcanosh/vc-scheduler:v1.15.0
args:
- --logtostderr
- --scheduler-conf=/volcano.scheduler/volcano-scheduler.conf
Expand Down
8 changes: 4 additions & 4 deletions installer/volcano-development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ spec:
- --port=8443
- -v=4
- 2>&1
image: docker.io/volcanosh/vc-webhook-manager:latest
image: docker.io/volcanosh/vc-webhook-manager:v1.15.0
imagePullPolicy: Always
name: admission
volumeMounts:
Expand Down Expand Up @@ -252,7 +252,7 @@ spec:
restartPolicy: Never
containers:
- name: main
image: docker.io/volcanosh/vc-webhook-manager:latest
image: docker.io/volcanosh/vc-webhook-manager:v1.15.0
imagePullPolicy: Always
command: ["./gen-admission-secret.sh", "--service", "volcano-admission-service", "--namespace",
"volcano-system", "--secret", "volcano-admission-secret"]
Expand Down Expand Up @@ -9072,7 +9072,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: volcano-controllers
image: docker.io/volcanosh/vc-controller-manager:latest
image: docker.io/volcanosh/vc-controller-manager:v1.15.0
args:
- --logtostderr
- --enable-healthz=true
Expand Down Expand Up @@ -9294,7 +9294,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: volcano-scheduler
image: docker.io/volcanosh/vc-scheduler:latest
image: docker.io/volcanosh/vc-scheduler:v1.15.0
args:
- --logtostderr
- --scheduler-conf=/volcano.scheduler/volcano-scheduler.conf
Expand Down
1 change: 1 addition & 0 deletions pkg/scheduler/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ func GenerateNodeMapAndSlice(nodes map[string]*api.NodeInfo) map[string]fwk.Node
for _, node := range nodes {
nodeInfo := k8sframework.NewNodeInfo(node.Pods()...)
nodeInfo.SetNode(node.Node)
nodeInfo.ImageStates = node.CloneImageSummary()
nodeMap[node.Name] = nodeInfo
}
return nodeMap
Expand Down
85 changes: 85 additions & 0 deletions pkg/scheduler/framework/util_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
Copyright 2025 The Volcano Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package framework

import (
"testing"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
fwk "k8s.io/kube-scheduler/framework"

"volcano.sh/volcano/pkg/scheduler/api"
)

func TestGenerateNodeMapAndSlice_ImageStates(t *testing.T) {
node := &v1.Node{
ObjectMeta: metav1.ObjectMeta{Name: "node1"},
Status: v1.NodeStatus{
Allocatable: v1.ResourceList{},
},
}

nodeInfo := api.NewNodeInfo(node)
nodeInfo.ImageStates = map[string]*fwk.ImageStateSummary{
"docker.io/library/nginx:latest": {
Size: 100 * 1024 * 1024,
NumNodes: 3,
},
"docker.io/library/redis:7": {
Size: 50 * 1024 * 1024,
NumNodes: 5,
},
}

nodes := map[string]*api.NodeInfo{
"node1": nodeInfo,
}

nodeMap := GenerateNodeMapAndSlice(nodes)

k8sNodeInfo, ok := nodeMap["node1"]
if !ok {
t.Fatalf("expected node1 in nodeMap")
}

if len(k8sNodeInfo.GetImageStates()) != 2 {
t.Fatalf("expected 2 image states, got %d", len(k8sNodeInfo.GetImageStates()))
}

nginxState, ok := k8sNodeInfo.GetImageStates()["docker.io/library/nginx:latest"]
if !ok {
t.Fatalf("expected nginx image state")
}
if nginxState.Size != 100*1024*1024 {
t.Errorf("expected nginx size 100MB, got %d", nginxState.Size)
}
if nginxState.NumNodes != 3 {
t.Errorf("expected nginx NumNodes 3, got %d", nginxState.NumNodes)
}

redisState, ok := k8sNodeInfo.GetImageStates()["docker.io/library/redis:7"]
if !ok {
t.Fatalf("expected redis image state")
}
if redisState.Size != 50*1024*1024 {
t.Errorf("expected redis size 50MB, got %d", redisState.Size)
}
if redisState.NumNodes != 5 {
t.Errorf("expected redis NumNodes 5, got %d", redisState.NumNodes)
}
}