diff --git a/examples/image.json b/examples/image.json index 7f9a4c72..4ec3ffa2 100644 --- a/examples/image.json +++ b/examples/image.json @@ -76,7 +76,8 @@ "protocol": "tcp", "socketActivated": true } - ] + ], + "supportsNotify" : false }, "dependencies": [ { diff --git a/schema/types/app.go b/schema/types/app.go index df13bf1c..9727e6ac 100644 --- a/schema/types/app.go +++ b/schema/types/app.go @@ -32,6 +32,7 @@ type App struct { MountPoints []MountPoint `json:"mountPoints,omitempty"` Ports []Port `json:"ports,omitempty"` Isolators Isolators `json:"isolators,omitempty"` + SupportsNotify bool `json:"supportsNotify"` } // app is a model to facilitate extra validation during the diff --git a/schema/types/app_test.go b/schema/types/app_test.go index cd056d6c..ff70b4bd 100644 --- a/schema/types/app_test.go +++ b/schema/types/app_test.go @@ -70,6 +70,13 @@ func TestAppValid(t *testing.T) { Group: "0", WorkingDirectory: "/tmp", }, + App{ + Exec: []string{}, + User: "0", + Group: "0", + WorkingDirectory: "/tmp", + SupportsNotify: false, + }, } for i, tt := range tests { if err := tt.assertValid(); err != nil { @@ -211,6 +218,19 @@ func TestAppUnmarshal(t *testing.T) { }, false, }, + { + `{"Exec":["/a"],"User":"0","Group":"0"}`, + &App{ + Exec: Exec{ + "/a", + }, + User: "0", + Group: "0", + Environment: make(Environment, 0), + SupportsNotify: false, + }, + false, + }, } for i, tt := range tests { a := &App{} diff --git a/spec/aci.md b/spec/aci.md index d3d0fd9a..932cdaab 100644 --- a/spec/aci.md +++ b/spec/aci.md @@ -169,7 +169,8 @@ JSON Schema for the Image Manifest (app image manifest, ACI manifest), conformin "count": 1000, "protocol": "tcp" } - ] + ], + "supportsNotify" : false }, "dependencies": [ { @@ -239,6 +240,7 @@ JSON Schema for the Image Manifest (app image manifest, ACI manifest), conformin * **port** (integer, required) port number that will be used; see also **count**. Must be >=1 and <=65535. * **count** (integer, optional, defaults to 1 if unset) specifies a range of ports, starting with "port" and ending with "port" + "count" - 1. Must be >=1. * **socketActivated** (boolean, optional, defaults to "false" if unsupplied) if set to true, the application expects to be [socket activated](http://www.freedesktop.org/software/systemd/man/sd_listen_fds.html) on these ports. To perform socket activation, the ACE MUST pass file descriptors using the [socket activation protocol](http://www.freedesktop.org/software/systemd/man/sd_listen_fds.html) that are listening on these ports when starting this app. If multiple apps in the same pod are using socket activation then the ACE must match the sockets to the correct apps using getsockopt() and getsockname(). + * **supportsNotify** (boolean, optional, defaults to "false" if unset) if set to true, the application should use [sd_notify()](https://www.freedesktop.org/software/systemd/man/sd_notify.html) to signal when it is ready. Setting this parameter to true for an application that does not send a ready signal with `sd_notify()` may result in misbehave. * **dependencies** (list of objects, optional) dependent application images that need to be placed down into the rootfs before the files from this image (if any). The ordering is significant. See [Dependency Matching](#dependency-matching) for how dependencies are retrieved. * **imageName** (string of type [AC Identifier](types.md#ac-identifier-type), required) name of the dependent App Container Image. * **imageID** (string of type [Image ID](types.md#image-id-type), optional) content hash of the dependency. If provided, the retrieved dependency must match the hash. This can be used to produce deterministic, repeatable builds of an App Container Image that has dependencies.