Commit 122237a
committed
Enable parsing the OCI linux configuration on non-linux platforms
What does this patch do?
Make the LinuxSpec be visible by golang on non-linux platforms when “go build”
What did this patch change?
Rename config_linux.go to config-linux.go
Rename runtime_config_linux.go to runtime-config-linux.go
Rename runtime_config.go to runtime-config.go (unnecessary to the patch, but it the last name with “_”)
Remove the “// +build linux” from config-linux.go
The type LinuxSpec (or say the OCI linux configuration) is a structure
describing some information, there is no executable code bound to the linux,
so the LinuxSpec should be naturally usable by any platform when needed.
But the file name (ended with “_linux.go”) and the build tag disallow
us to do so. The patch change it.
After making the LinuxSpec be visible on non-linux platforms, anyone can
do anything of the following in any platforms. (They are also the useful usecases)
1) parse the OCI linux configuration
2) verify the OCI linux configuration or the bundle
3) check or test the OCI linux configuration or even the bundle
4) discover/build/deliver linux OCI bundle
5) Run the container via the hypervisor-based runtime on non-linux platforms
etc.)
The 5) is one thing of what we are focusing on. After this patch applied, we can
directly use the opencontainers/spec under Godeps/ in our runv.git[1] project.
So anyone can build the runv and run linux container on darwin.
[1]: https://github.com/hyperhq/runv
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>1 parent 138deee commit 122237a
3 files changed
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
File renamed without changes.
File renamed without changes.
0 commit comments