mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to master@31c870e82a48
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
25
vendor/github.com/moby/buildkit/client/llb/merge.go
generated
vendored
25
vendor/github.com/moby/buildkit/client/llb/merge.go
generated
vendored
@ -70,6 +70,31 @@ func (m *MergeOp) Inputs() []Output {
|
||||
return m.inputs
|
||||
}
|
||||
|
||||
// Merge merges multiple states into a single state. This is useful in
|
||||
// conjunction with [Diff] to create set of patches which are independent of
|
||||
// each other to a base state without affecting the cache of other merged
|
||||
// states.
|
||||
// As an example, lets say you have a rootfs with the following directories:
|
||||
//
|
||||
// / /bin /etc /opt /tmp
|
||||
//
|
||||
// Now lets say you want to copy a directory /etc/foo from one state and a
|
||||
// binary /bin/bar from another state.
|
||||
// [Copy] makes a duplicate of file on top of another directory.
|
||||
// Merge creates a directory whose contents is an overlay of 2 states on top of each other.
|
||||
//
|
||||
// With "Merge" you can do this:
|
||||
//
|
||||
// fooState := Diff(rootfs, fooState)
|
||||
// barState := Diff(rootfs, barState)
|
||||
//
|
||||
// Then merge the results with:
|
||||
//
|
||||
// Merge(rootfs, fooDiff, barDiff)
|
||||
//
|
||||
// The resulting state will have both /etc/foo and /bin/bar, but because Merge
|
||||
// was used, changing the contents of "fooDiff" does not require copying
|
||||
// "barDiff" again.
|
||||
func Merge(inputs []State, opts ...ConstraintsOpt) State {
|
||||
// filter out any scratch inputs, which have no effect when merged
|
||||
var filteredInputs []State
|
||||
|
Reference in New Issue
Block a user