Skip to content

Commit

Permalink
Enable parsing the OCI linux configuration on non-linux platforms
Browse files Browse the repository at this point in the history
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
laijs committed Sep 2, 2015
1 parent 138deee commit 122237a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions config_linux.go → config-linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build linux

package specs

// LinuxSpec is the full specification for linux containers.
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 122237a

Please sign in to comment.