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

Container "Annotations" cannot be read from stdin by (prestart) hook #1686

Closed
FlorianOtel opened this issue Jan 11, 2018 · 1 comment · Fixed by #1687
Closed

Container "Annotations" cannot be read from stdin by (prestart) hook #1686

FlorianOtel opened this issue Jan 11, 2018 · 1 comment · Fixed by #1687

Comments

@FlorianOtel
Copy link

FlorianOtel commented Jan 11, 2018

Caveat emptor: Being relatively new to this, I'm not sure if I'm doing something wrong or this is a genuine bug / missing feature. TIA for your guidance.

Description:

Inspired by https://github.com/jessfraz/netns/blob/master/interface.go#L215-#L231 I wrote a little piece of code that -- when run as a (prestart) hook -- reads the container state from stdin.

The code is here: https://github.com/OpenPlatformSDN/nuage-oci-plugin/blob/master/runc/runc.go

The problem: The hook does read the correct information, except Annotations -- which is the part I am interested in.

On the other hand runc state <container_ID> does list the correct annotations.

The "config.json" for the container -- containing the hook and Annotations is (partly) shown here: https://gist.github.com/FlorianOtel/dc12ae370b87f3d51527af5dcdeee797

The difference on how the hook reads the data vs how runc state ... lists it is shown here: https://gist.github.com/FlorianOtel/73707cd372309ca0d566daabd9120e52

As can be read from the last gist, the hook data reads annotations as Annotations:map[string]string(nil) i.e. nothing can be read from stdin.

Please advise if this is an issue with my code, a missing feature or a bug.

Thanks,

/Florian

P.S. Forgot to mention the runc version:

runc version 1.0.0-rc4 spec: 1.0.0

If this is a bug / missing feature that was fixed in subsequent versions, please advise.

@runcom
Copy link
Member

runcom commented Jan 11, 2018

Fix is here #1687

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

Successfully merging a pull request may close this issue.

2 participants