retry
This commit is contained in:
parent
a2268af3fc
commit
aeea4e7f8c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8
main.go
8
main.go
|
@ -94,7 +94,10 @@ func listContainers() ([]Container, error) {
|
|||
|
||||
for scanner.Scan() {
|
||||
fields := strings.Fields(scanner.Text())
|
||||
if len(fields) < 3 {
|
||||
|
||||
// Check that there are at least 5 fields before accessing them
|
||||
if len(fields) < 5 {
|
||||
log.Printf("Warning: Skipping incomplete line: %s", scanner.Text())
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -109,7 +112,8 @@ func listContainers() ([]Container, error) {
|
|||
// Run 'docker inspect' to get detailed container information.
|
||||
env, networks, err := inspectContainer(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
log.Printf("Warning: Error inspecting container %s: %v", id, err)
|
||||
continue
|
||||
}
|
||||
|
||||
containers = append(containers, Container{
|
||||
|
|
Loading…
Reference in New Issue