-
Notifications
You must be signed in to change notification settings - Fork 296
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
set annotations when creating sanbodx and containers #369
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,6 +202,8 @@ func toRuntimeAPIContainer(c *dockertypes.Container) (*runtimeapi.Container, err | |
if err != nil { | ||
return nil, err | ||
} | ||
// TODO: Currently docker ContainerList api doesn't return annotations, so annotations | ||
// still need to be extracted from labels here. | ||
Comment on lines
+205
to
+206
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not super comfortable with having different sources of truth for annotations depending on the CRI API endpoint queried. It would be straightforward to extend the ContainerList API to return container annotations; perhaps we should do that first so support can be added properly to cri-dockerd? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I'm working on it moby/moby#47866. May I mark this PR a WIP util docker-side supports it ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moby/moby#47866 has been merged into master branch, but released in Pre-release https://github.com/moby/moby/releases/tag/v27.0.0-rc.1. May I bump github.com/docker/docker from 26.1.2+incompatible to v27.0.0-rc.1+incompatible? @corhere |
||
labels, annotations := extractLabels(c.Labels) | ||
sandboxID := c.Labels[sandboxIDLabelKey] | ||
// The timestamp in dockertypes.Container is in seconds. | ||
|
@@ -269,6 +271,8 @@ func containerToRuntimeAPISandbox(c *dockertypes.Container) (*runtimeapi.PodSand | |
if err != nil { | ||
return nil, err | ||
} | ||
// TODO: Currently docker ContainerList api doesn't return annotations, so annotations | ||
// still need to be extracted from labels here. | ||
labels, annotations := extractLabels(c.Labels) | ||
// The timestamp in dockertypes.Container is in seconds. | ||
createdAt := c.Created * int64(time.Second) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backward compatibility with what? AIUI no containers will be persisted across an upgrade (daemon restart) so there is no need for containers started by cri-dockerd v0.3.x to be understandable by v0.4.x, or vice versa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two main considerations for backward compatibility: