This commit is contained in:
Colin 2024-08-29 11:04:41 -04:00
parent a2268af3fc
commit aeea4e7f8c
8 changed files with 6 additions and 2 deletions

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.

View File

@ -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{