Giter Site home page Giter Site logo

Comments (1)

soharaki avatar soharaki commented on July 23, 2024

[Question]
Could we get the Metadata which has the log path from ContainerServices in containerd/client ?
I supposed that the client library don't support it.

And I discovered the issue about the custom log path...
containerd/containerd#4045

I've tried to use the "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"'s RuntimeServices, but it currently fails to get the object from the containerID. (because the container store in containerd is empty, although the grpc communication is successful).
https://github.com/soharaki/nerdctl/blob/add_logs_opt/logs.go#L72

# Running a container
$ sudo nerdctl run -it alpine
/ #

# Get the container id
$ sudo nerdctl ps -no-trunc
CONTAINER ID                                                        IMAGE                              COMMAND      CREATED           STATUS     PORTS    NAMES
aa369f2744e48f213577d63bc5fbbf58e58f2027ab161061ae2c99de45596c10    docker.io/library/alpine:latest    "/bin/sh"    42 seconds ago    Running

# Get logs, but it's failed
$ sudo nerdctl logs aa369f2744e48f213577d63bc5fbbf58e58f2027ab161061ae2c99de45596c10
FATA[0000] rpc error: code = NotFound desc = an error occurred when try to find container "aa369f2744e48f213577d63bc5fbbf58e58f2027ab161061ae2c99de45596c10": not found

# Also `crictl ps` result
$ sudo crictl -r unix:///run/containerd/containerd.sock ps
CONTAINER           IMAGE               CREATED             STATE               NAME                ATTEMPT             POD ID

I would appreciate any advices. Thank you.

from nerdctl.

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.