-
Notifications
You must be signed in to change notification settings - Fork 550
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
Add annotations and labels to the Spec. #331
Conversation
Do we need Labels and Annotations in both spec and state? I thought Labels were more of a runtime grouping mechanism so belong to the state and Annotations static and hence should be in the spec config. |
@mrunalp the labels are useful in both places. And as far as annotations, there may be runtimes that need to stash runtime specific metadata, and it would provide a clean place to do so. |
It looks like the runtime will be ignoring ‘annotations’ 1. Why not I'm -1 on labels (which do impact the runtime interface) until we have |
How much do we care about the On Fri, Mar 4, 2016 at 1:34 PM, W. Trevor King [email protected]
|
On Fri, Mar 04, 2016 at 01:54:50PM -0800, Vish Kannan wrote:
I care because it is the key that allows container access without |
@philips @crosbymichael @mrunalp @vbatts: How do we want to move forward on this PR? |
@vishh Could you give use cases for each as we had discussed in the call? I think that will help move this. |
I'm still unclear why we need to. its like 2x the complexity and ppl could be confused when and why to use each one. |
On Tue, Mar 08, 2016 at 10:42:38AM -0800, Michael Crosby wrote:
One is for opaque-to-the-runtime data, and the other is for grouping
|
Signed-off-by: Vishnu kannan <[email protected]>
ce688a7
to
1c49f4d
Compare
Updates PR to not include Labels. Removed Annotations from |
LGTM |
1 similar comment
LGTM |
Add annotations and labels to the Spec.
Signed-off-by: Vincent Batts <[email protected]>
@@ -18,6 +18,8 @@ type Spec struct { | |||
Mounts []Mount `json:"mounts"` | |||
// Hooks are the commands run at various lifecycle events of the container. | |||
Hooks Hooks `json:"hooks"` | |||
// Annotations is an unstructured key value map that may be set by external tools to store and retrieve arbitrary metadata. | |||
Annotations map[string]string `json:"annotations,omitempty"` |
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.
Are we sure we don't want an opaque type here? Or will we just revisit that later when somebody needs something that doesn't fit into a map[string]string
?
The spec now has opaque 'annotations', although: * It's a map[string]string and I would have prefered an opaque-in-the-runtime-spec type for an opaque-to-the-runtime field [1]. * It doesn't address arbitrary bundle content [2], but I have a separate tag for that [3]. [1]: opencontainers/runtime-spec#331 (comment) [2]: Message-ID: <[email protected]> Subject: Re: Labels and extension meta data in containers #108 Date: Wed, 30 Dec 2015 20:54:37 -0800 [3]: Message-ID: <[email protected]> Subject: Dropping the rootfs requirement and restoring arbitrary bundle content Date: Wed, 26 Aug 2015 12:54:47 -0700
Change made with: $ sed -i 's/\t/ /g' config.md fixing tabs that were added with 1c49f4d (Add annotations and labels to the Spec, 2016-03-04, opencontainers#331). Signed-off-by: W. Trevor King <[email protected]>
Change made with: $ sed -i 's/\t/ /g' config.md fixing tabs that were added with 1c49f4d (Add annotations and labels to the Spec, 2016-03-04, opencontainers#331). Signed-off-by: W. Trevor King <[email protected]>
The spec was not very clear on how state annotations are related to [config annotations. In the pull-request that landed state annotations, it sounds like these were supposed to be copied opaquely from the config [1]. It's still not clear to me why we'd copy annotations but not the rest of the config [2], but I'm leaving that alone for now. There was previous interest in runtime-specified annotations [3,4] (e.g. a RunV socket path [5]), but this commit does not allow runtimes to inject additional entries because I don't like: * Relying on config authors to avoid squatting on the namespace used by the runtime (if ties are broken in favor of the config) or * Silently clobbering configured annotations (if ties are broken in favor of the runtime). My preference would be to follow [3] and: * Only include runtime-specified information in the state annotations. * Require state readers to follow 'bundle' to the config.json if they wanted configured annotations (or embed the whole config.json in the state). But with 1.0 released and spec-maintainer comments like [1], I think it's too late to return to that approach. If we want to expose runtime-specified annotations, I think we'll need a new state property. There has been previous discussion of using "labels" and "annotations" to carry both types of information in the state [6], and while it's not as elegant as a full config copy, the labels/annotations approach is still viable. [1]: opencontainers#484 (comment) [2]: opencontainers#484 (comment) [3]: opencontainers#188 [4]: opencontainers#331 (comment) [5]: opencontainers#188 (comment) [6]: opencontainers#331 (comment) Signed-off-by: W. Trevor King <[email protected]>
The spec was not very clear on how state annotations are related to config annotations. In the pull-request that landed state annotations, it sounds like these were supposed to be copied opaquely from the config [1]. It's still not clear to me why we'd copy annotations but not the rest of the config [2], but I'm leaving that alone for now. There was previous interest in runtime-specified annotations [3,4] (e.g. a RunV socket path [5]), but this commit does not allow runtimes to inject additional entries because I don't like: * Relying on config authors to avoid squatting on the namespace used by the runtime (if ties are broken in favor of the config) or * Silently clobbering configured annotations (if ties are broken in favor of the runtime). My preference would be to follow [3] and: * Only include runtime-specified information in the state annotations. * Require state readers to follow 'bundle' to the config.json if they wanted configured annotations (or embed the whole config.json in the state). But with 1.0 released and spec-maintainer comments like [1], I think it's too late to return to that approach. If we want to expose runtime-specified annotations, I think we'll need a new state property. There has been previous discussion of using "labels" and "annotations" to carry both types of information in the state [6], and while it's not as elegant as a full config copy, the labels/annotations approach is still viable. [1]: opencontainers#484 (comment) [2]: opencontainers#484 (comment) [3]: opencontainers#188 [4]: opencontainers#331 (comment) [5]: opencontainers#188 (comment) [6]: opencontainers#331 (comment) Signed-off-by: W. Trevor King <[email protected]>
Fixes #108