Skip to content

Commit 9371318

Browse files
committed
proto: Drop LinuxSpec (and work around 'linux' sensitivity)
With LinuxSpec, a parser will have to know ahead of time what sort of config it's reading, any you'll end up with config JSON like: { "spec": { ...platform agnostic stuff ... }, "linux_config": { ...Linux-specific stuff... } } By dropping it and adding a LinuxConfig entry to Spec itself, we get back to our Markdown-specified: { ...platform agnostic stuff... , "linux": { ...Linux-specific stuff... } } As a minor (I hope) wrinkle, I've changed the field name from "linux" to "linuxx" to avoid: $ make protoc --cpp_out=./cpp/ config.proto pkg-config --cflags protobuf # fails if protobuf is not installed -pthread c++ example.cc ./cpp/config.pb.cc -o example_cpp $(pkg-config --cflags --libs protobuf) -I ./cpp ./cpp/config.pb.h:159:25: error: expected unqualified-id before numeric constant const ::oci::Process& linux() const; ^ ... that seems tied to attributes named "linux". Hopefully someone will figure out how to avoid that, in which case we can drop the silly "linuxx" name. Signed-off-by: W. Trevor King <[email protected]>
1 parent 2e87acb commit 9371318

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

proto/config.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,12 @@
2020
],
2121
"cwd": "/"
2222
},
23-
"hostname": ""
23+
"hostname": "",
24+
"linuxx": {
25+
"capabilities": [
26+
"CAP_AUDIT_WRITE",
27+
"CAP_KILL",
28+
"CAP_NET_BIND_SERVICE"
29+
]
30+
}
2431
}

proto/config.proto

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,8 @@ message Spec {
2020
// Mounts profile configuration for adding mounts to the container's
2121
// filesystem.
2222
repeated MountPoint mounts = 6;
23-
}
24-
25-
26-
// LinuxSpec is the full specification for linux containers.
27-
message LinuxSpec {
28-
Spec spec = 1;
29-
// LinuxConfig is platform specific configuration for linux based
30-
// containers.
31-
LinuxConfig linux_config = 2;
23+
// LinuxConfig is the Linux-specific, host-independent configuration.
24+
LinuxConfig linuxx = 7;
3225
}
3326

3427
// LinuxConfig contains platform specific configuration for linux based

0 commit comments

Comments
 (0)