Add support for override of parameters using a label

Using the label `org.mobyproject.config` will use that JSON
(or yaml, but it is very hard to get yaml into a label as newlines are
not respected) for parameters that are not explicitly set in the yaml file.

Had to change parameter definitions so override behaves as expected.

fix #16

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack
2017-05-17 13:59:14 +01:00
parent df7f50a755
commit c734b47e9c
5 changed files with 374 additions and 90 deletions

View File

@@ -125,7 +125,7 @@ func enforceContentTrust(fullImageName string, config *TrustConfig) bool {
// Perform the actual build process
// TODO return error not panic
func buildInternal(m *Moby, name string, pull bool) []byte {
func buildInternal(m Moby, name string, pull bool) []byte {
w := new(bytes.Buffer)
iw := tar.NewWriter(w)
@@ -177,7 +177,7 @@ func buildInternal(m *Moby, name string, pull bool) []byte {
}
for i, image := range m.Onboot {
log.Infof(" Create OCI config for %s", image.Image)
config, err := ConfigToOCI(&image)
config, err := ConfigToOCI(image)
if err != nil {
log.Fatalf("Failed to create config.json for %s: %v", image.Image, err)
}
@@ -196,7 +196,7 @@ func buildInternal(m *Moby, name string, pull bool) []byte {
}
for _, image := range m.Services {
log.Infof(" Create OCI config for %s", image.Image)
config, err := ConfigToOCI(&image)
config, err := ConfigToOCI(image)
if err != nil {
log.Fatalf("Failed to create config.json for %s: %v", image.Image, err)
}