Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information