Skip to content

Commit

Permalink
Fix using two tags when running docker inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx committed Jan 21, 2025
1 parent c1097d0 commit cbee752
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func setupKubernetes(
}

func dockerInspectCommand(
imageName string,
imageNameWithTag string,
runOptions *command.RunOptions,
) command.Output {
return command.Run(
Expand All @@ -442,7 +442,7 @@ func dockerInspectCommand(
"inspect",
"--format",
"{{index .RepoDigests 0}}",
imageName+":"+build.DefaultCacheTag,
imageNameWithTag,
),
runOptions,
)
Expand Down
5 changes: 3 additions & 2 deletions pkg/deploy/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ import (
"strings"
"testing"

"github.com/3lvia/cli/pkg/build"
"github.com/3lvia/cli/pkg/command"
)

func TestDockerInspectCommand(t *testing.T) {
t.Parallel()

const imageName = "ghcr.io/3lvia/core/demo-api"
const imageName = "ghcr.io/3lvia/core/demo-api" + build.DefaultCacheTag

expectedCommandString := strings.Join(
[]string{
"docker",
"inspect",
"--format",
"{{index .RepoDigests 0}}",
imageName + ":latest-cache",
imageName,
},
" ",
)
Expand Down

0 comments on commit cbee752

Please sign in to comment.