Giter Club home page Giter Club logo

Comments (3)

tnk4on avatar tnk4on commented on May 24, 2024

I found the cause.
ctx -> ir.ClientCtx

I am working on it and will open a PR.

// ManifestListClear clears out all instances from a manifest list
func (ir *ImageEngine) ManifestListClear(ctx context.Context, name string) (string, error) {
listContents, err := manifests.InspectListData(ctx, name, &manifests.InspectOptions{})
if err != nil {
return "", err
}
for _, instance := range listContents.Manifests {
if _, err := manifests.Remove(ctx, name, instance.Digest.String(), &manifests.RemoveOptions{}); err != nil {
return "", err
}
}
return name, nil
}

from podman.

rhatdan avatar rhatdan commented on May 24, 2024

Great thanks.

from podman.

tnk4on avatar tnk4on commented on May 24, 2024

I now know why this issue slipped through the test.

Even with the current code, the first podman farm build succeeds in a clean test environment. This is because it simply pushes the generated manifest.

However, the second run requires deleting the existing manifest in the registry, which is not possible with the current code.

Along with modifying the code, the test needs to be modified so that the command is executed more than once.

$ podman run --rm -d -p 5000:5000 --name registry quay.io/libpod/registry:2.8
d8858c872ae214900da90ec55ce647ad7f8f44b2b1bd63196c9134f9a73e8528
$ podman images
REPOSITORY                TAG         IMAGE ID      CREATED       SIZE
docker.io/library/alpine  latest      ace17d5d883e  3 months ago  8.02 MB
quay.io/libpod/registry   2.8         7aff825fd082  2 years ago   23.1 MB
$ cat ../test/Containerfile 
FROM alpine
RUN arch | tee /arch.txt
RUN date | tee /built.txt
$ podman system connection ls
Name        URI                                                          Identity                    Default     ReadWrite
test-node   ssh://user@localhost:22/run/user/1000/podman/podman.sock     /home/user/.ssh/id_rsa      false       true
$ podman farm ls
Name        Connections  Default     ReadWrite
fm1         [test-node]  true        true

### first time ###

$ podman --remote farm build --tls-verify=false -t localhost:5000/test-image-5 ../test
Setting up local builder
Local builder ready
Connecting to "test-node"
Builder "test-node" ready
Farm "fm1" ready
Starting build for [{linux arm64 v8}] at "(local)"
[linux/arm64/v8@(local)] STEP 1/3: FROM alpine
[linux/arm64/v8@(local)] STEP 2/3: RUN arch | tee /arch.txt
[linux/arm64/v8@(local)] aarch64
[linux/arm64/v8@(local)] --> 171aefd5e758
[linux/arm64/v8@(local)] STEP 3/3: RUN date | tee /built.txt
[linux/arm64/v8@(local)] Sat May 11 04:53:49 UTC 2024
[linux/arm64/v8@(local)] COMMIT
[linux/arm64/v8@(local)] --> a9a944181252
[linux/arm64/v8@(local)] a9a9441812525f24f848fb94e66b136d5176302f6e07b12fc3ea4f38bc5c0243
finished build for [{linux arm64 v8}] at "(local)": built a9a9441812525f24f848fb94e66b136d5176302f6e07b12fc3ea4f38bc5c0243
Getting image source signatures
Copying blob sha256:510c42af1e324bbfc80e43c268cdfa0a381e1e8d715d8d5d5d04b7bf463b3ed1
Copying blob sha256:b09314aec293bcd9a8ee5e643539437b3846f9e5e55f79e282e5f67e3026de5e
Copying blob sha256:5e3fcf103ee086d22fed57b1e494c4fd260e7b0354e50a4e83e21185284470ae
Copying config sha256:a9a9441812525f24f848fb94e66b136d5176302f6e07b12fc3ea4f38bc5c0243
Writing manifest to image destination
Getting image list signatures
Copying 0 images generated from 1 images in list
Writing manifest list to image destination
Storing list signatures
Saved list to "localhost:5000/test-image-5"

### 2nd time ###

$ podman --remote farm build --tls-verify=false -t localhost:5000/test-image-5 ../test
Setting up local builder
Local builder ready
Connecting to "test-node"
Builder "test-node" ready
Farm "fm1" ready
Starting build for [{linux arm64 v8}] at "(local)"
[linux/arm64/v8@(local)] STEP 1/3: FROM alpine
[linux/arm64/v8@(local)] STEP 2/3: RUN arch | tee /arch.txt
[linux/arm64/v8@(local)] --> Using cache 171aefd5e7582d0143f7ce5a504df652f5e8b35b5442a99816af4e716e5a4f91
[linux/arm64/v8@(local)] --> 171aefd5e758
[linux/arm64/v8@(local)] STEP 3/3: RUN date | tee /built.txt
[linux/arm64/v8@(local)] --> Using cache a9a9441812525f24f848fb94e66b136d5176302f6e07b12fc3ea4f38bc5c0243
[linux/arm64/v8@(local)] --> a9a944181252
[linux/arm64/v8@(local)] a9a9441812525f24f848fb94e66b136d5176302f6e07b12fc3ea4f38bc5c0243
finished build for [{linux arm64 v8}] at "(local)": built a9a9441812525f24f848fb94e66b136d5176302f6e07b12fc3ea4f38bc5c0243
Getting image source signatures
Copying blob sha256:510c42af1e324bbfc80e43c268cdfa0a381e1e8d715d8d5d5d04b7bf463b3ed1
Copying blob sha256:5e3fcf103ee086d22fed57b1e494c4fd260e7b0354e50a4e83e21185284470ae
Copying blob sha256:b09314aec293bcd9a8ee5e643539437b3846f9e5e55f79e282e5f67e3026de5e
Copying config sha256:a9a9441812525f24f848fb94e66b136d5176302f6e07b12fc3ea4f38bc5c0243
Writing manifest to image destination
Error: build: error clearing list "localhost:5000/test-image-5"

from podman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.