Skip to content

Commit a0848cd

Browse files
authored
Merge pull request #66 from stuartleeks/sl/devcontainer-label-update
Update label to match change in dev containers
2 parents b487d6c + 0d8e419 commit a0848cd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/spf13/cobra v1.0.0
1212
github.com/spf13/viper v1.4.0
1313
github.com/stretchr/testify v1.7.0
14-
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
14+
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d // indirect
1515
gopkg.in/yaml.v2 v2.4.0 // indirect
1616
)
1717

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ golang.org/x/sys v0.0.0-20211030160813-b3129d9d1021 h1:giLT+HuUP/gXYrG2Plg9WTjj4
191191
golang.org/x/sys v0.0.0-20211030160813-b3129d9d1021/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
192192
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0=
193193
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
194+
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d h1:Zu/JngovGLVi6t2J3nmAf3AoTDwuzw85YZ3b9o4yU7s=
195+
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
194196
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
195197
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
196198
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

internal/pkg/devcontainers/dockerutils.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var _ = listPartComposeContainerNumber
4343

4444
// ListDevcontainers returns a list of devcontainers
4545
func ListDevcontainers() ([]DevcontainerInfo, error) {
46-
cmd := exec.Command("docker", "ps", "--format", "{{.ID}}|{{.Label \"vsch.local.folder\"}}|{{.Label \"com.docker.compose.project\"}}|{{.Label \"com.docker.compose.service\"}}|{{.Label \"com.docker.compose.container-number\"}}|{{.Names}}")
46+
cmd := exec.Command("docker", "ps", "--format", "{{.ID}}|{{.Label \"devcontainer.local_folder\"}}|{{.Label \"com.docker.compose.project\"}}|{{.Label \"com.docker.compose.service\"}}|{{.Label \"com.docker.compose.container-number\"}}|{{.Names}}")
4747

4848
output, err := cmd.Output()
4949
if err != nil {
@@ -93,9 +93,8 @@ func ListDevcontainers() ([]DevcontainerInfo, error) {
9393

9494
// GetLocalFolderFromDevContainer looks up the local (host) folder name from the container labels
9595
func GetLocalFolderFromDevContainer(containerIDOrName string) (string, error) {
96-
//docker inspect cool_goldberg --format '{{ index .Config.Labels "vsch.local.folder" }}'
9796

98-
cmd := exec.Command("docker", "inspect", containerIDOrName, "--format", "{{ index .Config.Labels \"vsch.local.folder\" }}")
97+
cmd := exec.Command("docker", "inspect", containerIDOrName, "--format", "{{ index .Config.Labels \"devcontainer.local_folder\" }}")
9998

10099
output, err := cmd.Output()
101100
if err != nil {

0 commit comments

Comments
 (0)