Skip to content

Commit

Permalink
pull init container images before creating
Browse files Browse the repository at this point in the history
  • Loading branch information
nkubala committed Aug 27, 2021
1 parent fa814e3 commit 46f40ff
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/docker-deploy/skaffold.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: skaffold/v2beta22
apiVersion: skaffold/v2beta21
kind: Config
build:
local:
Expand Down
4 changes: 3 additions & 1 deletion integration/diagnose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ func folders(root string) ([]string, error) {
}

for _, f := range files {
folders = append(folders, f.Name())
if f.Mode().IsDir() {
folders = append(folders, f.Name())
}
}

return folders, err
Expand Down
3 changes: 3 additions & 0 deletions pkg/skaffold/deploy/docker/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ func (d *Deployer) deploy(ctx context.Context, out io.Writer, b graph.Artifact)
// skip duplication of init containers
continue
}
if err := d.client.Pull(ctx, out, c.Image); err != nil {
return errors.Wrap(err, "pulling init container image")
}
id, err := d.client.Run(ctx, out, c, dockerutil.ContainerCreateOpts{})
if err != nil {
return errors.Wrap(err, "creating container in local docker")
Expand Down
3 changes: 2 additions & 1 deletion pkg/skaffold/docker/debugger/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import (
"context"
"testing"

"github.com/docker/docker/api/types/container"

"github.com/GoogleContainerTools/skaffold/pkg/skaffold/debug/types"
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/graph"
"github.com/GoogleContainerTools/skaffold/testutil"
"github.com/docker/docker/api/types/container"
)

func TestConfigurationsAndImages(t *testing.T) {
Expand Down

0 comments on commit 46f40ff

Please sign in to comment.