Skip to content

Commit

Permalink
Fix: issue cri-dockerd runtime not being found (#1899)
Browse files Browse the repository at this point in the history
* Fix: issue cri-dockerd runtime not being found

Signed-off-by: Vadym Tartakovskyi <[email protected]>
  • Loading branch information
FlikweertvisionVadym authored Jan 30, 2025
1 parent c393385 commit 3fccad9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/daemon/criruntime/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ func detectRuntime(varRunPath string) (cfgs []runtimeConfig) {
runtimeRemoteURI: fmt.Sprintf("unix://%s/cri-dockerd.sock", varRunPath),
})
}
// Check if the cri-dockerd runtime socket exists in the expected k3s runtime directory.
// If found, append it to the runtime configuration list to ensure k3s can use cri-dockerd.
if _, err = os.Stat(fmt.Sprintf("%s/cri-dockerd/cri-dockerd.sock", varRunPath)); err == nil {
cfgs = append(cfgs, runtimeConfig{
runtimeType: ContainerRuntimeCommonCRI,
runtimeRemoteURI: fmt.Sprintf("unix://%s/cri-dockerd/cri-dockerd.sock", varRunPath),
})
}
}
return cfgs
}

0 comments on commit 3fccad9

Please sign in to comment.