-
Notifications
You must be signed in to change notification settings - Fork 65
build: Add ability to override images with YAML #96
Conversation
See my comments in the issue, filenames must not be special. |
b7ad403
to
9ab2af6
Compare
Rebased and updated to add an |
cmd/moby/build.go
Outdated
@@ -18,6 +18,7 @@ import ( | |||
) | |||
|
|||
const defaultNameForStdin = "moby" | |||
const overrideFile = "override.yml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
9ab2af6
to
4167c07
Compare
Removed the unused |
This commit adds a schema and parsing logic for an override.yml. This file is applied to an already parsed Moby config and will replace all instances of the source pattern with the substitute pattern. This allows for easy replacement of images in a config file for development or test. Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
4167c07
to
a10f139
Compare
Updated again to fix a bug. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature seems a bit strange to me. Why does it just blanket override every image in different sections (that happens to match)? How would you override non-image properties?
Why wouldn't overrides just be one file applies over another?
Ok, I understand the use case is pretty limited right now, but I think we should expect that more use cases will present themselves as this tool becomes more popular. We should try to design something that can be extended. I think the current design is really limited. What do you think about supporting multiple files and applying the config of one other the other? That way every field can be updated. It would also let you override just one image if they have the same value. |
We already support multiple files. But they don't currently override, they are additive. In some cases we could support override, by saying that if the |
Closing as the design of this feature needs more thought |
This commit adds a schema and parsing logic for an override.yml.
This file is applied to an already parsed Moby config and will replace
all instances of the source pattern with the substitute pattern.
This allows for easy replacement of images in a config file for
development or test.
Fixes: #95
Signed-off-by: Dave Tucker dave@dtucker.co.uk