Skip to content

Commit 9efcebe

Browse files
Merge branch 'main' into docs/kind-tutorial-index
2 parents 5d04b98 + 5416def commit 9efcebe

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/contributors.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ users:
9292
neo-0007:
9393
name: Hrishikesh Gohain
9494
email: hrishikeshgohain123@gmail.com
95-
abhaygoudannavar:
96-
name: Abhay Goudannavar
97-
email: YOUR_EMAIL_HERE
9895
abhaygoudannavar:
9996
name: AbhayGoudannavar
10097
email: abhaysgoudnvr@gmail.com
98+
rishi-jat:
99+
name: Rishi Jat
100+
email: rishijat098@gmail.com

pkg/unikontainers/unikontainers.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func New(bundlePath string, containerID string, rootDir string, cfg *UruncConfig
7070
return nil, err
7171
}
7272

73+
if spec == nil || spec.Linux == nil {
74+
return nil, fmt.Errorf("invalid OCI spec: linux section is required")
75+
}
76+
7377
containerName := spec.Annotations["io.kubernetes.cri.container-name"]
7478
if containerName == "queue-proxy" {
7579
uniklog.Warn("This is a queue-proxy container. Adding IP env.")
@@ -125,6 +129,9 @@ func Get(containerID string, rootDir string) (*Unikontainer, error) {
125129
if err != nil {
126130
return nil, err
127131
}
132+
if spec == nil || spec.Linux == nil {
133+
return nil, fmt.Errorf("invalid OCI spec: linux section is required")
134+
}
128135
u.BaseDir = containerDir
129136
u.RootDir = rootDir
130137
u.Spec = spec
@@ -357,7 +364,7 @@ func (u *Unikontainer) Exec(metrics m.Writer) error {
357364

358365
// ExecArgs
359366
// If memory limit is set in spec, use it instead of the config default value
360-
if u.Spec.Linux.Resources.Memory != nil {
367+
if u.Spec.Linux.Resources != nil && u.Spec.Linux.Resources.Memory != nil {
361368
if u.Spec.Linux.Resources.Memory.Limit != nil {
362369
if *u.Spec.Linux.Resources.Memory.Limit > 0 {
363370
vmmArgs.MemSizeB = uint64(*u.Spec.Linux.Resources.Memory.Limit) // nolint:gosec

0 commit comments

Comments
 (0)