mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
userns: Wrap more errors
Most errors where already wrapped, but these were missing. Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
This commit is contained in:
parent
c0eb9e3433
commit
e885986393
@ -434,12 +434,12 @@ func (m *UsernsManager) GetOrCreateUserNamespaceMappings(pod *v1.Pod, runtimeHan
|
|||||||
if string(content) != "" {
|
if string(content) != "" {
|
||||||
userNs, err = m.parseUserNsFileAndRecord(pod.UID, content)
|
userNs, err = m.parseUserNsFileAndRecord(pod.UID, content)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("user namespace: %w", err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
userNs, err = m.createUserNs(pod)
|
userNs, err = m.createUserNs(pod)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("create user namespace: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,7 +490,7 @@ func (m *UsernsManager) CleanupOrphanedPodUsernsAllocations(pods []*v1.Pod, runn
|
|||||||
allFound := sets.New[string]()
|
allFound := sets.New[string]()
|
||||||
found, err := m.kl.ListPodsFromDisk()
|
found, err := m.kl.ListPodsFromDisk()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("user namespace: read pods from disk: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, podUID := range found {
|
for _, podUID := range found {
|
||||||
|
Loading…
Reference in New Issue
Block a user