Skip to content

Commit 910b027

Browse files
committed
refactor: add helpful logs
- fix segfault if warm-metal fails to fetch size from the container registry
1 parent 7d848ac commit 910b027

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

cmd/plugin/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ func main() {
158158
}
159159

160160
if size != nil {
161+
klog.Infof("'--max-image-size' is set to '%v'", size.String())
161162
imagesize.Initialize(size)
162163
defer imagesize.Warner.Cleanup()
163164
}

pkg/remoteimage/pull.go

+2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ func (p puller) Pull(ctx context.Context, pod string, ns string) (err error) {
8686

8787
func (p puller) checkForImageSize(cred *cri.AuthConfig, pod string, ns string) {
8888
go func() {
89+
klog.Infof("fetching image size from the registry for '%v'", p.image)
8990
if w.Warner != nil {
9091
size, err := w.Warner.GetImageSize(cred, p.image)
9192
if err != nil {
9293
klog.Infof("error fetching image size from the registry: %v", err)
94+
return
9395
}
9496
w.Warner.Warn(size, pod, ns)
9597
}

0 commit comments

Comments
 (0)