Imaginator: add flag to by default inherit computed files, filters and triggers.#255
Conversation
7165c97 to
3012d0d
Compare
rgooch
left a comment
There was a problem hiding this comment.
I was not expecting changes to cmd/builder-tool. Requiring the user to make this choice/be aware of the issue negates the benefit. This should just be an option for cmd/imaginator.
The thinking is that the current behaviour is actually a bug/inconsistency, and we should fix that bug, but do so with a global flag set by the Imaginator administrator, so that they can take responsibility for any potential problems.
Yes, Updated flag description to reflect the intended behavior in builder-tool |
…itance of computed-files, filters, triggers
3012d0d to
611f107
Compare
…associated subcommand
| return nil, err | ||
| } | ||
| // Return empty slice if empty file. | ||
| computedFileList = []ComputedFile{} |
There was a problem hiding this comment.
This is a change to the API behaviour which may cause surprises elsewhere. There's a general pattern in the repository where an empty slice is treated differently than a nil slice (see for example filters). Please revert this piece and adapt the caller if a nil slice could cause problems.
There was a problem hiding this comment.
Moved the existence check to the caller for correct evaluation while maintaining backward compatibility and avoiding API changes.
A different approach is required here because the return type is a slice, unlike the pointer-based return types used in triggers and filters.
|
@rgooch If There is currently no way for such a child image to explicitly remain sparse. An empty filter file results in an empty filter (full coverage), whereas sparse behavior is represented by a Should we introduce a mechanism to explicitly preserve the |
Description & Motivation
This PR introduces
-enableDefaultInheritanceflag toimaginatorandbuilder-tool. When this flag is enabled, child images inherittriggers,filtersandcomputed-filesfrom sourceImage without need of empty.addfilesThis also maintains backward compatibility for existing image manifests functionality
Behavior matrix
Note: "metadata file" below refers to
filter,computed-filesortriggers-enableDefaultInheritanceFlag.addfile is presentChild has no metadata.
Child inherits metadata exactly as defined in base image.
Child has no metadata.
Child has no metadata.
Child uses its own metadata.
Child uses its own metadata.
.addfile existsChild appends rules to base metadata
Child appends rules to base metadata
Fixes #247
Type of Change
How Has This Been Tested?
Testing Approach
Build images using local imageserver, imaginator, builder-tool and verify files based on test cases for desired results
Checklist: