Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove docker image list reference filter #1501

Merged
merged 7 commits into from
Jan 13, 2023

Conversation

ChristopherHX
Copy link
Contributor

@ChristopherHX ChristopherHX commented Dec 10, 2022

Should I preserve the public ImageExistsLocally signature and make a private helper function?, reverted the new return value.

This uses docker inspect and remove docker list.
You cannot have multiple images of the same name+tag, regardless of platform metadata

Fixes #1390

@ChristopherHX ChristopherHX changed the title refactor: remove docker reference filter refactor: fix remove docker reference filter Dec 10, 2022
@codecov
Copy link

codecov bot commented Dec 10, 2022

Codecov Report

Merging #1501 (9c9a6c6) into master (4989f44) will increase coverage by 0.21%.
The diff coverage is 70.76%.

@@            Coverage Diff             @@
##           master    #1501      +/-   ##
==========================================
+ Coverage   61.22%   61.44%   +0.21%     
==========================================
  Files          46       46              
  Lines        7141     7148       +7     
==========================================
+ Hits         4372     4392      +20     
+ Misses       2462     2450      -12     
+ Partials      307      306       -1     
Impacted Files Coverage Δ
pkg/container/docker_cli.go 82.23% <ø> (ø)
pkg/container/docker_logger.go 52.08% <ø> (ø)
pkg/container/docker_pull.go 33.33% <ø> (ø)
pkg/container/docker_run.go 13.58% <ø> (ø)
pkg/container/docker_volume.go 0.00% <ø> (ø)
pkg/container/docker_images.go 27.02% <29.41%> (-4.13%) ⬇️
pkg/container/docker_auth.go 51.35% <56.25%> (+3.73%) ⬆️
pkg/container/docker_build.go 59.49% <100.00%> (+0.51%) ⬆️
pkg/runner/command.go 94.16% <100.00%> (+1.73%) ⬆️
pkg/runner/job_executor.go 88.40% <100.00%> (+0.71%) ⬆️
... and 4 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ChristopherHX ChristopherHX marked this pull request as ready for review December 10, 2022 22:03
@ChristopherHX ChristopherHX requested a review from a team as a code owner December 10, 2022 22:03
pkg/container/docker_images.go Outdated Show resolved Hide resolved

imageListOptions := types.ImageListOptions{
Filters: filters,
inspectImage, _, err := cli.ImageInspectWithRaw(ctx, imageName)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One docker inpect call is enough, no container list needed with non portable filters
Docker beta only, they may contribute the filter to containerd

return false, err
}

cli, err := GetDockerClient(ctx)
if err != nil {
return false, err
}
defer cli.Close()
Copy link
Contributor Author

@ChristopherHX ChristopherHX Dec 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did I forget this leak or is it new? Should be closed.
Seems like it got lost, my fork has a close instruction and, I have made the last change in this file.

It is better to keep two return values
@mergify
Copy link
Contributor

mergify bot commented Dec 18, 2022

We have a CI issue, not shure if it is permanent

---> Running in c456a53ef29b
  Removing intermediate container c456a53ef29b
   ---> 7a021e1fde7a
  Step 3/6 : RUN apk add --no-cache bash ca-certificates git   && apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing add mono mono-dev   && cert-sync /etc/ssl/certs/ca-certificates.crt   && wget "https://github.com/chocolatey/choco/archive/${CHOCOVERSION}.tar.gz" -O- | tar -xzf -   && cd choco-"${CHOCOVERSION}"   && chmod +x build.sh zip.sh   && ./build.sh -v   && mv ./code_drop/chocolatey/console /opt/chocolatey   && mkdir -p /opt/chocolatey/lib   && rm -rf /choco-"${CHOCOVERSION}"   && apk del mono-dev   && rm -rf /var/cache/apk/*
   ---> Running in c2c034542234
  fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
  fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
  (1/11) Installing ncurses-terminfo-base (6.3_p[20](https://github.com/nektos/act/actions/runs/3724658856/jobs/6316953303#step:17:21)2205[21](https://github.com/nektos/act/actions/runs/3724658856/jobs/6316953303#step:17:22)-r0)
  (2/11) Installing ncurses-libs (6.3_p20220521-r0)
  (3/11) Installing readline (8.1.2-r0)
  (4/11) Installing bash (5.1.16-r2)
  Executing bash-5.1.16-r2.post-install
  (5/11) Installing ca-certificates (20220614-r0)
  (6/11) Installing brotli-libs (1.0.9-r6)
  (7/11) Installing nghttp2-libs (1.47.0-r0)
  (8/11) Installing libcurl (7.83.1-r4)
  (9/11) Installing expat (2.5.0-r0)
  (10/11) Installing pcre2 (10.40-r0)
  (11/11) Installing git (2.36.3-r0)
  Executing busybox-1.35.0-r17.trigger
  Executing ca-certificates-20220614-r0.trigger
  OK: 22 MiB in 25 packages
  fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
  fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
  fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
  ERROR: unable to select packages:
    libgdiplus-dev (no such package):
      required by: mono-dev-6.12.0.182-r0[libgdiplus-dev]
  The command '/bin/sh -c apk add --no-cache bash ca-certificates git   && apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing add mono mono-dev   && cert-sync /etc/ssl/certs/ca-certificates.crt   && wget "[https://github.com/chocolatey/choco/archive/${CHOCOVERSION}.tar.gz](https://github.com/chocolatey/choco/archive/$%7BCHOCOVERSION%7D.tar.gz)" -O- | tar -xzf -   && cd choco-"${CHOCOVERSION}"   && chmod +x build.sh zip.sh   && ./build.sh -v   && mv ./code_drop/chocolatey/console /opt/chocolatey   && mkdir -p /opt/chocolatey/lib   && rm -rf /choco-"${CHOCOVERSION}"   && apk del mono-dev   && rm -rf /var/cache/apk/*' returned a non-zero code: 2
Error: Docker build failed with exit code 2

@mergify mergify bot added the needs-work Extra attention is needed label Dec 18, 2022
@ChristopherHX ChristopherHX changed the title refactor: fix remove docker reference filter refactor: remove docker image list reference filter Dec 18, 2022
@mergify mergify bot removed the needs-work Extra attention is needed label Dec 19, 2022
Copy link
Member

@KnisterPeter KnisterPeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mergify
Copy link
Contributor

mergify bot commented Jan 13, 2023

@ChristopherHX this pull request has failed checks 🛠

@mergify mergify bot added needs-work Extra attention is needed and removed needs-work Extra attention is needed labels Jan 13, 2023
@mergify mergify bot merged commit b2fb9e6 into nektos:master Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker Desktop 22.06.0-beta: invalid filter 'reference'
3 participants