Skip to content

Commit b140792

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 e695ddb commit b140792

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/introspection/local.go

+3
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ func (l *Local) getUUID() (string, error) {
163163
}
164164
return "", err
165165
}
166+
if len(data) == 0 {
167+
return l.generateUUID()
168+
}
166169
u := string(data)
167170
if _, err := uuid.Parse(u); err != nil {
168171
return "", err

0 commit comments

Comments
 (0)