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

Add labels to the state #188

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ This allows the hooks to perform cleanup and teardown logic after the runtime de
* **`bundlePath`**: (string) is the absolute path to the container's bundle directory.
This is provided so that consumers can find the container's configuration and root filesystem on the host.

* **`annotations`**: (interface) holds runtime-specified information that is not structured by this specification.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does an interface mean outside of golang?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Mon, Nov 16, 2015 at 07:59:57PM -0800, Vish Kannan wrote:

+* annotations: (interface) holds runtime-specified
information that is not structured by this specification.

What does an interface mean outside of golang?

Data with an unspecified schema. E.g. void* in C 1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, this is weird. We are already saying this is JSON encoded, so we should just say the type here is an arbitrary JSON type (either an object or a value). "interface" is unhelpful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

On Wed, Dec 16, 2015 at 10:53 AM, Jonathan Boulle notifications@github.com
wrote:

In runtime.md
#188 (comment):

@@ -23,6 +23,9 @@ This allows the hooks to perform cleanup and teardown logic after the runtime de

  • bundlePath: (string) is the absolute path to the container's bundle directory.
    This is provided so that consumers can find the container's configuration and root filesystem on the host.

+* annotations: (interface) holds runtime-specified information that is not structured by this specification.

Eh, this is weird. We are already saying this is JSON encoded
https://github.com/opencontainers/specs/pull/188/files#diff-b84a8d65d8ed53f4794cd2db7e8ea731L11,
so we should just say the type here is an arbitrary JSON type (either an
object or a value). "interface" is unhelpful.


Reply to this email directly or view it on GitHub
https://github.com/opencontainers/specs/pull/188/files#r47816296.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Wed, Dec 16, 2015 at 10:53:41AM -0800, Jonathan Boulle wrote:

+* annotations: (interface) holds runtime-specified information that is not structured by this specification.

Eh, this is weird. We are already saying this is JSON
encoded
,
so we should just say the type here is an arbitrary JSON type
(either an object or a value). "interface" is unhelpful.

“interface” is a Go-ism. So I'm fine with interface in the Go type
and “JSON” in these Markdown docs.

The runtime could store experimental information here before it's standardized in this specification.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a recommended format for the values? Is it byte encoded or string or something else?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the use-cases. Clarify that. In the future, we can add experimental API versions, which might handle this use-case.


*Example*

```json
Expand Down
2 changes: 2 additions & 0 deletions state.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ type State struct {
Pid int `json:"pid"`
// BundlePath is the path to the container's bundle directory.
BundlePath string `json:"bundlePath"`
// Annotations holds runtime-specified information that is not structured by this specification.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we mentioning runtime here? Are we precluding humans from ever trying to use this Spec 😃 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Mon, Nov 16, 2015 at 08:01:42PM -0800, Vish Kannan wrote:

  • // Annotations holds runtime-specified information that is not
    structured by this specification.

Why are we mentioning runtime here? Are we precluding humans from
ever trying to use this Spec 😃 ?

No, we're reserving this namespace for the runtime to define. So
anyone is welcome to read it, but the runtime is the ultimate
authority on any specification for the content, and the only one who
should be writing to it. Otherwise we'd need sub-namespaces to keep
different players separate (e.g. see 1, but Gao pointed out that we
didn't need a state JSON entry for the bundle author 2).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find out other users of annotations right now, can you show me the use case? absolutely you can read it, but right now only runtime stores information in it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename runtime to users instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Wed, Dec 16, 2015 at 10:36:16AM -0800, Vish Kannan wrote:

  • // Annotations holds runtime-specified information that is not structured by this specification.

Can we rename runtime to users instead?

This is runtime-specified information. User information just goes
somewhere in the bundle directory 1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But what prevents users from adding their own metadata here? At the Spec level, why do we have to differentiate between runtimes and other users?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Mon, Jan 04, 2016 at 11:45:11AM -0800, Vish Kannan wrote:

  • // Annotations holds runtime-specified information that is not structured by this specification.

But what prevents users from adding their own metadata here?

There are no technical limits to something like 1, but with a
required BundlePath there is no need 2. My personal preference
would be to drop the BundlePath requirement 3, but addressing that
seems like it's outside the scope for this PR.

Annotations interface{} `json:"annotations"`
}