Skip to content

Commit f4fc366

Browse files
Merge pull request #716 from ManManavadaria/bugfix/index-out-of-range-713
Fix index out of range panic using containerID fallback (#713)
2 parents 78edbf3 + 322e10d commit f4fc366

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.github/workflows/cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
- name: Unshallow repo
1515
run: git fetch --prune --unshallow
1616
- name: Setup Go
17-
uses: actions/setup-go@v1
17+
uses: actions/setup-go@v6
1818
with:
19-
go-version: 1.21.x
19+
go-version: 1.24.x
2020
- name: Run goreleaser
2121
uses: goreleaser/goreleaser-action@v1
2222
with:

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Continuous Integration
22

33
env:
4-
GO_VERSION: 1.21
4+
GO_VERSION: 1.24
55

66
on:
77
push:
@@ -25,9 +25,9 @@ jobs:
2525
- name: Checkout code
2626
uses: actions/checkout@v2
2727
- name: Setup Go
28-
uses: actions/setup-go@v1
28+
uses: actions/setup-go@v6
2929
with:
30-
go-version: 1.21.x
30+
go-version: 1.24.x
3131
- name: Cache build
3232
uses: actions/cache@v4
3333
with:
@@ -47,9 +47,9 @@ jobs:
4747
- name: Checkout code
4848
uses: actions/checkout@v2
4949
- name: Setup Go
50-
uses: actions/setup-go@v1
50+
uses: actions/setup-go@v6
5151
with:
52-
go-version: 1.21.x
52+
go-version: 1.24.x
5353
- name: Cache build
5454
uses: actions/cache@v4
5555
with:
@@ -75,9 +75,9 @@ jobs:
7575
- name: Checkout code
7676
uses: actions/checkout@v2
7777
- name: Setup Go
78-
uses: actions/setup-go@v1
78+
uses: actions/setup-go@v6
7979
with:
80-
go-version: 1.21.x
80+
go-version: 1.24.x
8181
- name: Cache build
8282
uses: actions/cache@v4
8383
with:
@@ -102,9 +102,9 @@ jobs:
102102
- name: Checkout code
103103
uses: actions/checkout@v2
104104
- name: Setup Go
105-
uses: actions/setup-go@v1
105+
uses: actions/setup-go@v6
106106
with:
107-
go-version: 1.21.x
107+
go-version: 1.24.x
108108
- name: Cache build
109109
uses: actions/cache@v4
110110
with:

pkg/commands/docker.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,11 @@ func (c *DockerCommand) GetContainers(existingContainers []*Container) ([]*Conta
256256
if name, ok := ctr.Labels["name"]; ok {
257257
newContainer.Name = name
258258
} else {
259-
newContainer.Name = strings.TrimLeft(ctr.Names[0], "/")
259+
if len(ctr.Names) > 0 {
260+
newContainer.Name = strings.TrimLeft(ctr.Names[0], "/")
261+
} else {
262+
newContainer.Name = ctr.ID
263+
}
260264
}
261265
newContainer.ServiceName = ctr.Labels["com.docker.compose.service"]
262266
newContainer.ProjectName = ctr.Labels["com.docker.compose.project"]

0 commit comments

Comments
 (0)