Add podman/pull with a docker/pull wrapper and unit test all of it
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/docker/export_test.go Mon Oct 11 00:45:39 2021 -0500
@@ -0,0 +1,27 @@
+ . "github.com/onsi/gomega" + "keep.imfreedom.org/grim/convey/tasks" +func TestExport(t *testing.T) { + Files: []string{".:."}, + g.Expect(e.Valid()).To(BeNil()) +func TestExportFilesRequired(t *testing.T) { + g.Expect(e.Valid()).To(MatchError(tasks.ErrNoFiles)) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/docker/import_test.go Mon Oct 11 00:45:39 2021 -0500
@@ -0,0 +1,27 @@
+ . "github.com/onsi/gomega" + "keep.imfreedom.org/grim/convey/tasks" +func TestImport(t *testing.T) { + Files: []string{".:."}, + g.Expect(e.Valid()).To(BeNil()) +func TestImportFilesRequired(t *testing.T) { + g.Expect(e.Valid()).To(MatchError(tasks.ErrNoFiles)) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/docker/pull.go Mon Oct 11 00:45:39 2021 -0500
@@ -0,0 +1,44 @@
+ log "github.com/sirupsen/logrus" + "keep.imfreedom.org/grim/convey/environment" + "keep.imfreedom.org/grim/convey/podman" + "keep.imfreedom.org/grim/convey/runtime" + "keep.imfreedom.org/grim/convey/tasks" + "keep.imfreedom.org/grim/convey/yaml" + Image string `yaml:"image"` + Images yaml.StringOrSlice `yaml:"images"` +func (p *Pull) Execute(name string, logger *log.Entry, stageEnv environment.Environment, rt *runtime.Runtime) error { + return p.realPull.Execute(name, logger, stageEnv, rt) +func (p *Pull) New() tasks.Task { +func (p *Pull) Valid() error { + p.Images = yaml.StringOrSlice{p.Image} + p.realPull = &podman.Pull{ + return p.realPull.Valid() +func (p *Pull) Deprecated() error { + return fmt.Errorf("docker/pull has been deprecated in favor of podman/pull since 0.15.0") --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/docker/pull_test.go Mon Oct 11 00:45:39 2021 -0500
@@ -0,0 +1,37 @@
+ . "github.com/onsi/gomega" + "keep.imfreedom.org/grim/convey/podman" +func TestPullImage(t *testing.T) { + g.Expect(p.Valid()).To(BeNil()) +func TestPullImages(t *testing.T) { + Images: []string{"foo", "bar"}, + g.Expect(p.Valid()).To(BeNil()) +func TestPullImageRequired(t *testing.T) { + g.Expect(p.Valid()).To(MatchError(podman.ErrNoTags)) --- a/docker/tasks.go Mon Oct 11 00:26:37 2021 -0500
+++ b/docker/tasks.go Mon Oct 11 00:45:39 2021 -0500
@@ -10,6 +10,7 @@
"docker/export": &Export{},
"docker/login": &Login{},
"docker/logout": &Logout{},
+ "docker/pull": &Pull{}, --- a/podman/errors.go Mon Oct 11 00:26:37 2021 -0500
+++ b/podman/errors.go Mon Oct 11 00:45:39 2021 -0500
@@ -13,6 +13,6 @@
ErrNoUsername = errors.New("no username provided")
ErrNoPassword = errors.New("no password provided")
ErrNoTags = errors.New("no tags specified")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/podman/pull.go Mon Oct 11 00:45:39 2021 -0500
@@ -0,0 +1,51 @@
+ log "github.com/sirupsen/logrus" + "keep.imfreedom.org/grim/convey/environment" + "keep.imfreedom.org/grim/convey/exec" + "keep.imfreedom.org/grim/convey/runtime" + "keep.imfreedom.org/grim/convey/tasks" + "keep.imfreedom.org/grim/convey/yaml" + Tags yaml.StringOrSlice `yaml:"tags"` +func (p *Pull) Execute(name string, logger *log.Entry, stageEnv environment.Environment, rt *runtime.Runtime) error { + env := stageEnv.Copy().Merge(rt.Environment) + tags := env.Expandv(p.Tags) + for _, tag := range tags { + generator := exec.NewGenerator( + err := exec.Run(name, generator.Command(), rt.Timeout) +func (p *Pull) New() tasks.Task { +func (p *Pull) Valid() error { +func (p *Pull) Deprecated() error { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/podman/pull_test.go Mon Oct 11 00:45:39 2021 -0500
@@ -0,0 +1,37 @@
+ . "github.com/onsi/gomega" + "keep.imfreedom.org/grim/convey/yaml" +func TestPullString(t *testing.T) { + Tags: yaml.StringOrSlice{"foo"}, + g.Expect(p.Valid()).To(BeNil()) +func TestPullSlice(t *testing.T) { + Tags: []string{"foo", "bar"}, + g.Expect(p.Valid()).To(BeNil()) +func TestPullTagsRequired(t *testing.T) { + g.Expect(p.Valid()).To(MatchError(ErrNoTags)) --- a/podman/tasks.go Mon Oct 11 00:26:37 2021 -0500
+++ b/podman/tasks.go Mon Oct 11 00:45:39 2021 -0500
@@ -8,12 +8,11 @@
Tasks = map[string]tasks.Task{
"podman/login": &Login{},
"podman/logout": &Logout{},
+ "podman/pull": &Pull{}, - "docker/login": &Login{},
- "docker/logout": &Logout{},
--- a/tasks/errors.go Mon Oct 11 00:26:37 2021 -0500
+++ b/tasks/errors.go Mon Oct 11 00:45:39 2021 -0500
@@ -21,5 +21,5 @@
- errNoFiles = errors.New("no files specified")
+ ErrNoFiles = errors.New("no files specified") --- a/tasks/export.go Mon Oct 11 00:26:37 2021 -0500
+++ b/tasks/export.go Mon Oct 11 00:45:39 2021 -0500
@@ -40,7 +40,7 @@
// Valid validates the export task.
func (e *Export) Valid() error {
--- a/tasks/import.go Mon Oct 11 00:26:37 2021 -0500
+++ b/tasks/import.go Mon Oct 11 00:45:39 2021 -0500
@@ -41,7 +41,7 @@
// Valid validates the export task.
func (i *Import) Valid() error {