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

how to provide namespace wtih grpcurl #397

Open
coolninja1504 opened this issue May 25, 2023 · 1 comment
Open

how to provide namespace wtih grpcurl #397

coolninja1504 opened this issue May 25, 2023 · 1 comment

Comments

@coolninja1504
Copy link

Hi All,
I am using grpcurl to get list of images from containerd as follows:

grpcurl -plaintext -proto images.proto -unix /run/containerd/containerd.sock containerd.services.images.v1.Images/List

but getting following error:
ERROR:
Code: FailedPrecondition
Message: namespace is required: failed precondition

I tried giving the namespace as follows , but then getting another error:
./grpcurl -plaintext -d '{"namespace":"k8s.io"}' -proto images.proto -unix /run/containerd/containerd.sock containerd.services.images.v1.Images/List
Error invoking method "containerd.services.images.v1.Images/List": error getting request data: message type containerd.services.images.v1.ListImagesRequest has no known field named namespace

How can I give the namespace with grpcurl ?

Thanks

@jhump
Copy link
Contributor

jhump commented May 25, 2023

This is really a question for the containerd project, about how to use their API.

FWIW, you can use grpcurl describe to look at the definition for the RPC request (or look at API docs). Those show that there is no field named namespace; only a field named filters, which is an array of strings.

I happened to do some searching and found a hint here. In their example, showing a REST mapping for the gRPC API, they are setting a header named containerd-namespace. So I'm going to guess that you need an argument like -H "containerd-namespace: k8s.io". But if that doesn't work, this is not the place for more questions. I'd recommend asking in the containerd Slack: https://slack.containerd.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants