Skip to content

Commit a4846fc

Browse files
samuelkarpk8s-infra-cherrypick-robot
authored and
k8s-infra-cherrypick-robot
committed
introspection: regenerate UUID if state is empty
The /var/lib/containerd/io.containerd.grpc.v1.introspection/uuid file stores a UUID to identify the particular containerd daemon responding to requests. The file should either exist with a UUID, or not exist. However, it has been observed that the file can be truncated with 0 bytes, which will then fail to be parsed as a valid UUID. As a defensive practice, detect a 0-length file and overwrite with a new UUID rather than failing. Fixes: containerd#10491 Signed-off-by: Samuel Karp <[email protected]>
1 parent d157b85 commit a4846fc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/introspection/local.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ func (l *Local) getUUID() (string, error) {
146146
}
147147
return "", err
148148
}
149+
if len(data) == 0 {
150+
return l.generateUUID()
151+
}
149152
u := string(data)
150153
if _, err := uuid.Parse(u); err != nil {
151154
return "", err

0 commit comments

Comments
 (0)