Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package docker-compose for openSUSE:Factory 
checked in at 2022-09-08 14:22:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/docker-compose (Old)
 and      /work/SRC/openSUSE:Factory/.docker-compose.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "docker-compose"

Thu Sep  8 14:22:08 2022 rev:4 rq:1001678 version:2.10.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/docker-compose/docker-compose.changes    
2022-08-20 20:29:06.993428135 +0200
+++ /work/SRC/openSUSE:Factory/.docker-compose.new.2083/docker-compose.changes  
2022-09-08 14:22:43.874541192 +0200
@@ -1,0 +2,19 @@
+Wed Sep 07 06:51:12 UTC 2022 - [email protected]
+
+- Update to version 2.10.2:
+  * Makefile: mutualize local and Dockerfile build opts (#9776)
+  * Revert "Apply newly loaded envvars to `DockerCli` and `APIClient`" (#9792)
+
+-------------------------------------------------------------------
+Wed Sep 07 06:50:17 UTC 2022 - [email protected]
+
+- Update to version 2.10.1:
+  * ci: bring back individual checksum files
+  * build(deps): bump github.com/moby/buildkit from 0.10.3 to 0.10.4 (#9780)
+  * ci: fix checksums checking
+  * Pull image regardless of whether it exists locally if `tag=latest`
+  * Remove error message showing exit code when using --exit-code-from
+  * pull: only skip pull when policy is `missing`/`if_not_present`
+  * Wake up!
+
+-------------------------------------------------------------------

Old:
----
  compose-2.10.0.tar.gz

New:
----
  compose-2.10.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ docker-compose.spec ++++++
--- /var/tmp/diff_new_pack.HpWBEK/_old  2022-09-08 14:22:44.366542327 +0200
+++ /var/tmp/diff_new_pack.HpWBEK/_new  2022-09-08 14:22:44.370542336 +0200
@@ -19,7 +19,7 @@
 %define __arch_install_post export NO_BRP_STRIP_DEBUG=true
 
 Name:           docker-compose
-Version:        2.10.0
+Version:        2.10.2
 Release:        0
 Summary:        Define and run multi-container applications with Docker
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.HpWBEK/_old  2022-09-08 14:22:44.414542438 +0200
+++ /var/tmp/diff_new_pack.HpWBEK/_new  2022-09-08 14:22:44.418542448 +0200
@@ -3,7 +3,7 @@
     <param name="url">https://github.com/docker/compose</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
-    <param name="revision">v2.10.0</param>
+    <param name="revision">v2.10.2</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="changesgenerate">enable</param>
     <param name="versionrewrite-pattern">v(.*)</param>
@@ -16,7 +16,7 @@
     <param name="compression">gz</param>
   </service>
   <service name="go_modules" mode="disabled">
-    <param name="archive">compose-2.10.0.tar.gz</param>
+    <param name="archive">compose-2.10.2.tar.gz</param>
   </service>
 </services>
 

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.HpWBEK/_old  2022-09-08 14:22:44.434542484 +0200
+++ /var/tmp/diff_new_pack.HpWBEK/_new  2022-09-08 14:22:44.438542493 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://github.com/docker/compose</param>
-              <param 
name="changesrevision">f880b4129c0498299f2d731280093093c719b24e</param></service></servicedata>
+              <param 
name="changesrevision">69651136cfc2d1d7556b386e98de56b1b1854430</param></service></servicedata>
 (No newline at EOF)
 

++++++ compose-2.10.0.tar.gz -> compose-2.10.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/.github/workflows/ci.yml 
new/compose-2.10.2/.github/workflows/ci.yml
--- old/compose-2.10.0/.github/workflows/ci.yml 2022-08-19 16:28:55.000000000 
+0200
+++ new/compose-2.10.2/.github/workflows/ci.yml 2022-08-26 22:06:24.000000000 
+0200
@@ -199,8 +199,10 @@
         name: Create checksums
         working-directory: ${{ env.DESTDIR }}
         run: |
-          find . -type f -print0 | sort -z | xargs -r0 shasum -a 256 -b | sed 
's# .*/#  #' > checksums.txt
-          shasum -a 256 -U -c checksums.txt
+          find . -type f -print0 | sort -z | xargs -r0 shasum -a 256 -b | sed 
's# \*\./# *#' > $RUNNER_TEMP/checksums.txt
+          shasum -a 256 -U -c $RUNNER_TEMP/checksums.txt
+          mv $RUNNER_TEMP/checksums.txt .
+          cat checksums.txt | while read sum file; do echo "$sum $file" > 
${file#\*}.sha256; done
       -
         name: License
         run: cp packaging/* ${{ env.DESTDIR }}/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/.golangci.yml 
new/compose-2.10.2/.golangci.yml
--- old/compose-2.10.0/.golangci.yml    2022-08-19 16:28:55.000000000 +0200
+++ new/compose-2.10.2/.golangci.yml    2022-08-26 22:06:24.000000000 +0200
@@ -29,7 +29,7 @@
     - varcheck
 linters-settings:
   depguard:
-    list-type: blacklist
+    list-type: denylist
     include-go-root: true
     packages:
       # The io/ioutil package has been deprecated.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/Dockerfile 
new/compose-2.10.2/Dockerfile
--- old/compose-2.10.0/Dockerfile       2022-08-19 16:28:55.000000000 +0200
+++ new/compose-2.10.2/Dockerfile       2022-08-26 22:06:24.000000000 +0200
@@ -36,6 +36,7 @@
       docker \
       file \
       git \
+      make \
       protoc \
       protobuf-dev
 WORKDIR /src
@@ -68,20 +69,14 @@
   fi
 EOT
 
-FROM base AS version
-RUN --mount=target=. \
-    PKG=github.com/docker/compose/v2 VERSION=$(git describe --match 'v[0-9]*' 
--dirty='.m' --always --tags); \
-    echo "-X ${PKG}/internal.Version=${VERSION}" | tee /tmp/.ldflags; \
-    echo -n "${VERSION}" | tee /tmp/.version;
-
 FROM build-base AS build
 ARG BUILD_TAGS
 ARG TARGETPLATFORM
+RUN xx-go --wrap
 RUN --mount=type=bind,target=. \
     --mount=type=cache,target=/root/.cache \
     --mount=type=cache,target=/go/pkg/mod \
-    --mount=type=bind,source=/tmp/.ldflags,target=/tmp/.ldflags,from=version \
-    set -x; xx-go build -trimpath -tags "$BUILD_TAGS" -ldflags "$(cat 
/tmp/.ldflags) -w -s" -o /usr/bin/docker-compose ./cmd && \
+    make build GO_BUILDTAGS="$BUILD_TAGS" DESTDIR=/usr/bin && \
     xx-verify --static /usr/bin/docker-compose
 
 FROM build-base AS lint
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/Makefile new/compose-2.10.2/Makefile
--- old/compose-2.10.0/Makefile 2022-08-19 16:28:55.000000000 +0200
+++ new/compose-2.10.2/Makefile 2022-08-26 22:06:24.000000000 +0200
@@ -12,15 +12,11 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-ifneq (, $(BUILDX_BIN))
-       export BUILDX_CMD = $(BUILDX_BIN)
-else ifneq (, $(shell docker buildx version))
-       export BUILDX_CMD = docker buildx
-else ifneq (, $(shell which buildx))
-       export BUILDX_CMD = $(which buildx)
-else
-       $(error "Buildx is required: 
https://github.com/docker/buildx#installing";)
-endif
+PKG := github.com/docker/compose/v2
+VERSION ?= $(shell git describe --match 'v[0-9]*' --dirty='.m' --always --tags)
+
+GO_LDFLAGS ?= -s -w -X ${PKG}/internal.Version=${VERSION}
+GO_BUILDTAGS ?= e2e,kube
 
 UNAME_S := $(shell uname -s)
 ifeq ($(UNAME_S),Linux)
@@ -30,8 +26,6 @@
        MOBY_DOCKER=/Applications/Docker.app/Contents/Resources/bin/docker
 endif
 
-BINARY_FOLDER=$(shell pwd)/bin
-GIT_TAG?=$(shell git describe --tags --match "v[0-9]*")
 TEST_FLAGS?=
 E2E_TEST?=
 ifeq ($(E2E_TEST),)
@@ -39,14 +33,21 @@
        TEST_FLAGS=-run $(E2E_TEST)
 endif
 
-all: compose-plugin
+BUILDX_CMD ?= docker buildx
+DESTDIR ?= ./bin/build
 
-.PHONY: compose-plugin
-compose-plugin: ## Compile the compose cli-plugin
+all: build
+
+.PHONY: build ## Build the compose cli-plugin
+build:
+       CGO_ENABLED=0 GO111MODULE=on go build -trimpath -tags "$(GO_BUILDTAGS)" 
-ldflags "$(GO_LDFLAGS)" -o "$(DESTDIR)/docker-compose" ./cmd
+
+.PHONY: binary
+binary:
        $(BUILDX_CMD) bake binary
 
 .PHONY: install
-install: compose-plugin
+install: binary
        mkdir -p ~/.docker/cli-plugins
        install bin/build/docker-compose ~/.docker/cli-plugins/docker-compose
 
@@ -61,10 +62,10 @@
        go test $(TEST_FLAGS) -v -count=1 -parallel=1 --tags=standalone 
./pkg/e2e
 
 .PHONY: build-and-e2e-compose
-build-and-e2e-compose: compose-plugin e2e-compose ## Compile the compose 
cli-plugin and run end to end local tests in plugin mode. Set E2E_TEST=TestName 
to run a single test
+build-and-e2e-compose: build e2e-compose ## Compile the compose cli-plugin and 
run end to end local tests in plugin mode. Set E2E_TEST=TestName to run a 
single test
 
 .PHONY: build-and-e2e-compose-standalone
-build-and-e2e-compose-standalone: compose-plugin e2e-compose-standalone ## 
Compile the compose cli-plugin and run End to end local tests in standalone 
mode. Set E2E_TEST=TestName to run a single test
+build-and-e2e-compose-standalone: build e2e-compose-standalone ## Compile the 
compose cli-plugin and run End to end local tests in standalone mode. Set 
E2E_TEST=TestName to run a single test
 
 .PHONY: mocks
 mocks:
@@ -76,11 +77,11 @@
 e2e: e2e-compose e2e-compose-standalone ## Run end to end local tests in both 
modes. Set E2E_TEST=TestName to run a single test
 
 .PHONY: build-and-e2e
-build-and-e2e: compose-plugin e2e-compose e2e-compose-standalone ## Compile 
the compose cli-plugin and run end to end local tests in both modes. Set 
E2E_TEST=TestName to run a single test
+build-and-e2e: build e2e-compose e2e-compose-standalone ## Compile the compose 
cli-plugin and run end to end local tests in both modes. Set E2E_TEST=TestName 
to run a single test
 
 .PHONY: cross
 cross: ## Compile the CLI for linux, darwin and windows
-       $(BUILDX_CMD) bake binary
+       $(BUILDX_CMD) bake binary-cross
 
 .PHONY: test
 test: ## Run unit tests
@@ -124,7 +125,7 @@
 
 validate: validate-go-mod validate-headers validate-docs ## Validate sources
 
-pre-commit: validate check-dependencies lint compose-plugin test e2e-compose
+pre-commit: validate check-dependencies lint build test e2e-compose
 
 help: ## Show help
        @echo Please specify a build target. The choices are:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/cmd/compose/compose.go 
new/compose-2.10.2/cmd/compose/compose.go
--- old/compose-2.10.0/cmd/compose/compose.go   2022-08-19 16:28:55.000000000 
+0200
+++ new/compose-2.10.2/cmd/compose/compose.go   2022-08-26 22:06:24.000000000 
+0200
@@ -32,8 +32,6 @@
        dockercli "github.com/docker/cli/cli"
        "github.com/docker/cli/cli-plugins/manager"
        "github.com/docker/cli/cli/command"
-       "github.com/docker/cli/cli/flags"
-       "github.com/docker/docker/client"
        "github.com/morikuni/aec"
        "github.com/pkg/errors"
        "github.com/sirupsen/logrus"
@@ -293,18 +291,6 @@
                        if err != nil {
                                return err
                        }
-
-                       // Reset DockerCli and APIClient to get possible 
`DOCKER_HOST` and/or `DOCKER_CONTEXT` loaded from environment file.
-                       err = dockerCli.Apply(func(cli *command.DockerCli) 
error {
-                               return cli.Initialize(flags.NewClientOptions(),
-                                       command.WithInitializeClient(func(_ 
*command.DockerCli) (client.APIClient, error) {
-                                               return nil, nil
-                                       }))
-                       })
-                       if err != nil {
-                               return err
-                       }
-
                        parent := cmd.Root()
                        if parent != nil {
                                parentPrerun := parent.PersistentPreRunE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/go.mod new/compose-2.10.2/go.mod
--- old/compose-2.10.0/go.mod   2022-08-19 16:28:55.000000000 +0200
+++ new/compose-2.10.2/go.mod   2022-08-26 22:06:24.000000000 +0200
@@ -21,7 +21,7 @@
        github.com/hashicorp/go-version v1.6.0
        github.com/mattn/go-isatty v0.0.16
        github.com/mattn/go-shellwords v1.0.12
-       github.com/moby/buildkit v0.10.3
+       github.com/moby/buildkit v0.10.4
        github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6
        github.com/morikuni/aec v1.0.0
        github.com/opencontainers/go-digest v1.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/go.sum new/compose-2.10.2/go.sum
--- old/compose-2.10.0/go.sum   2022-08-19 16:28:55.000000000 +0200
+++ new/compose-2.10.2/go.sum   2022-08-26 22:06:24.000000000 +0200
@@ -1017,8 +1017,8 @@
 github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod 
h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
 github.com/moby/buildkit v0.8.1/go.mod 
h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ=
 github.com/moby/buildkit v0.10.1-0.20220403220257-10e6f94bf90d/go.mod 
h1:WvwAZv8aRScHkqc/+X46cRC2CKMKpqcaX+pRvUTtPes=
-github.com/moby/buildkit v0.10.3 
h1:/dGykD8FW+H4p++q5+KqKEo6gAkYKyBQHdawdjVwVAU=
-github.com/moby/buildkit v0.10.3/go.mod 
h1:jxeOuly98l9gWHai0Ojrbnczrk/rf+o9/JqNhY+UCSo=
+github.com/moby/buildkit v0.10.4 
h1:FvC+buO8isGpUFZ1abdSLdGHZVqg9sqI4BbFL8tlzP4=
+github.com/moby/buildkit v0.10.4/go.mod 
h1:Yajz9vt1Zw5q9Pp4pdb3TCSUXJBIroIQGQ3TTs/sLug=
 github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
 github.com/moby/locker v1.0.1/go.mod 
h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
 github.com/moby/spdystream v0.2.0/go.mod 
h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/pkg/compose/printer.go 
new/compose-2.10.2/pkg/compose/printer.go
--- old/compose-2.10.0/pkg/compose/printer.go   2022-08-19 16:28:55.000000000 
+0200
+++ new/compose-2.10.2/pkg/compose/printer.go   2022-08-26 22:06:24.000000000 
+0200
@@ -21,8 +21,6 @@
        "fmt"
 
        "github.com/docker/compose/v2/pkg/api"
-
-       "github.com/sirupsen/logrus"
 )
 
 // logPrinter watch application containers an collect their logs
@@ -99,7 +97,6 @@
                                                exitCodeFrom = event.Service
                                        }
                                        if exitCodeFrom == event.Service {
-                                               logrus.Error(event.ExitCode)
                                                exitCode = event.ExitCode
                                        }
                                }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/pkg/compose/pull.go 
new/compose-2.10.2/pkg/compose/pull.go
--- old/compose-2.10.0/pkg/compose/pull.go      2022-08-19 16:28:55.000000000 
+0200
+++ new/compose-2.10.2/pkg/compose/pull.go      2022-08-26 22:06:24.000000000 
+0200
@@ -88,16 +88,7 @@
                        })
                        continue
                case types.PullPolicyMissing, types.PullPolicyIfNotPresent:
-                       if _, ok := images[service.Image]; ok {
-                               w.Event(progress.Event{
-                                       ID:     service.Name,
-                                       Status: progress.Done,
-                                       Text:   "Skipped - Image is already 
present locally",
-                               })
-                               continue
-                       }
-               default:
-                       if _, ok := images[service.Image]; ok {
+                       if imageAlreadyPresent(service.Image, images) {
                                w.Event(progress.Event{
                                        ID:     service.Name,
                                        Status: progress.Done,
@@ -142,6 +133,19 @@
        return err
 }
 
+func imageAlreadyPresent(serviceImage string, localImages map[string]string) 
bool {
+       normalizedImage, err := reference.ParseDockerRef(serviceImage)
+       if err != nil {
+               return false
+       }
+       tagged, ok := normalizedImage.(reference.NamedTagged)
+       if !ok {
+               return false
+       }
+       _, ok = localImages[serviceImage]
+       return ok && tagged.Tag() != "latest"
+}
+
 func (s *composeService) pullServiceImage(ctx context.Context, service 
types.ServiceConfig, info moby.Info, configFile driver.Auth, w progress.Writer, 
quietPull bool) (string, error) {
        w.Event(progress.Event{
                ID:     service.Name,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/pkg/e2e/compose_test.go 
new/compose-2.10.2/pkg/e2e/compose_test.go
--- old/compose-2.10.0/pkg/e2e/compose_test.go  2022-08-19 16:28:55.000000000 
+0200
+++ new/compose-2.10.2/pkg/e2e/compose_test.go  2022-08-26 22:06:24.000000000 
+0200
@@ -119,54 +119,6 @@
        })
 }
 
-func TestComposePull(t *testing.T) {
-       c := NewParallelCLI(t)
-
-       t.Run("Verify image pulled", func(t *testing.T) {
-               // cleanup existing images
-               c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/simple", "down", "--rmi", "all")
-
-               res := c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/simple", "pull")
-               output := res.Combined()
-
-               assert.Assert(t, strings.Contains(output, "simple Pulled"))
-               assert.Assert(t, strings.Contains(output, "another Pulled"))
-       })
-
-       t.Run("Verify a image is pulled once", func(t *testing.T) {
-               // cleanup existing images
-               c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/duplicate-images", "down", "--rmi", "all")
-
-               res := c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/duplicate-images", "pull")
-               output := res.Combined()
-
-               if strings.Contains(output, "another Pulled") {
-                       assert.Assert(t, strings.Contains(output, "another 
Pulled"))
-                       assert.Assert(t, strings.Contains(output, "Skipped - 
Image is already being pulled by another"))
-               } else {
-                       assert.Assert(t, strings.Contains(output, "simple 
Pulled"))
-                       assert.Assert(t, strings.Contains(output, "Skipped - 
Image is already being pulled by simple"))
-               }
-       })
-
-       t.Run("Verify skipped pull if image is already present locally", func(t 
*testing.T) {
-               // make sure the required image is present
-               c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/image-present-locally", "pull")
-
-               res := c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/image-present-locally", "pull")
-               output := res.Combined()
-
-               assert.Assert(t, strings.Contains(output, "Skipped - Image is 
already present locally"))
-       })
-
-       t.Run("Verify skipped no image to be pulled", func(t *testing.T) {
-               res := c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/no-image-name-given", "pull")
-               output := res.Combined()
-
-               assert.Assert(t, strings.Contains(output, "Skipped - No image 
to be pulled"))
-       })
-}
-
 func TestDownComposefileInParentFolder(t *testing.T) {
        c := NewParallelCLI(t)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/compose-2.10.0/pkg/e2e/fixtures/compose-pull/image-present-locally/docker-compose.yaml
 
new/compose-2.10.2/pkg/e2e/fixtures/compose-pull/image-present-locally/docker-compose.yaml
--- 
old/compose-2.10.0/pkg/e2e/fixtures/compose-pull/image-present-locally/docker-compose.yaml
  2022-08-19 16:28:55.000000000 +0200
+++ 
new/compose-2.10.2/pkg/e2e/fixtures/compose-pull/image-present-locally/docker-compose.yaml
  2022-08-26 22:06:24.000000000 +0200
@@ -1,4 +1,9 @@
 services:
   simple:
     image: alpine:3.13.12
+    pull_policy: missing
+    command: top
+  latest:
+    image: alpine:latest
+    pull_policy: missing
     command: top
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/compose-2.10.0/pkg/e2e/pull_test.go 
new/compose-2.10.2/pkg/e2e/pull_test.go
--- old/compose-2.10.0/pkg/e2e/pull_test.go     1970-01-01 01:00:00.000000000 
+0100
+++ new/compose-2.10.2/pkg/e2e/pull_test.go     2022-08-26 22:06:24.000000000 
+0200
@@ -0,0 +1,81 @@
+/*
+   Copyright 2020 Docker Compose CLI authors
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+package e2e
+
+import (
+       "strings"
+       "testing"
+
+       "gotest.tools/v3/assert"
+)
+
+func TestComposePull(t *testing.T) {
+       c := NewParallelCLI(t)
+
+       t.Run("Verify image pulled", func(t *testing.T) {
+               // cleanup existing images
+               c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/simple", "down", "--rmi", "all")
+
+               res := c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/simple", "pull")
+               output := res.Combined()
+
+               assert.Assert(t, strings.Contains(output, "simple Pulled"))
+               assert.Assert(t, strings.Contains(output, "another Pulled"))
+
+               // verify default policy is 'always' for pull command
+               res = c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/simple", "pull")
+               output = res.Combined()
+
+               assert.Assert(t, strings.Contains(output, "simple Pulled"))
+               assert.Assert(t, strings.Contains(output, "another Pulled"))
+       })
+
+       t.Run("Verify a image is pulled once", func(t *testing.T) {
+               // cleanup existing images
+               c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/duplicate-images", "down", "--rmi", "all")
+
+               res := c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/duplicate-images", "pull")
+               output := res.Combined()
+
+               if strings.Contains(output, "another Pulled") {
+                       assert.Assert(t, strings.Contains(output, "another 
Pulled"))
+                       assert.Assert(t, strings.Contains(output, "Skipped - 
Image is already being pulled by another"))
+               } else {
+                       assert.Assert(t, strings.Contains(output, "simple 
Pulled"))
+                       assert.Assert(t, strings.Contains(output, "Skipped - 
Image is already being pulled by simple"))
+               }
+       })
+
+       t.Run("Verify skipped pull if image is already present locally", func(t 
*testing.T) {
+               // make sure the required image is present
+               c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/image-present-locally", "pull")
+
+               res := c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/image-present-locally", "pull")
+               output := res.Combined()
+
+               assert.Assert(t, strings.Contains(output, "simple Skipped - 
Image is already present locally"))
+               // image with :latest tag gets pulled regardless if 
pull_policy: missing or if_not_present
+               assert.Assert(t, strings.Contains(output, "latest Pulled"))
+       })
+
+       t.Run("Verify skipped no image to be pulled", func(t *testing.T) {
+               res := c.RunDockerComposeCmd(t, "--project-directory", 
"fixtures/compose-pull/no-image-name-given", "pull")
+               output := res.Combined()
+
+               assert.Assert(t, strings.Contains(output, "Skipped - No image 
to be pulled"))
+       })
+}

++++++ vendor.tar.gz ++++++
/work/SRC/openSUSE:Factory/docker-compose/vendor.tar.gz 
/work/SRC/openSUSE:Factory/.docker-compose.new.2083/vendor.tar.gz differ: char 
5, line 1

Reply via email to