|
||
|
||
|
||
|
||
|
||
jkaluza commented 4 years ago | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
jkaluza commented 4 years ago This part about "-docker" -> "-container" is removed completely, because "-docker" suffix cannot be used for long time and all the images are already switched to "-container". If we keep it here, it will make this change much more complex, because we will also need to handle the situation where "x-docker" and "x-container" are not treated as different parent images. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
jkaluza commented 4 years ago This is the | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
jkaluza commented 4 years ago This | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
jkaluza commented 4 years ago And this is what we used to have here originally before we introduced the second phase of this method. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Consider following situations:
foo-1-1
has x-1-1
parent image.foo-1-2
has y-1-1
parent image.bar-1-1
has foo-1-1
parent image.When Freshmaker generates the list of images to rebuild, the current code
does not handle the case when older foo
image was built against x-1-1
and newer foo
against y-1-1
well. It will generate following list:
bar-1-1
will be rebuilt against foo-1-2
, because foo-1-2
is the latest release.foo-1-2
will be rebuilt against x-1-1
, because original parent of
bar-1-1was
foo-1-1and it depended on
x-1-1. This is wrong. In fact, it should be built againsty
which is y-1-1
.This PR fixes this problem by introducing another initial phase in code which
deduplicates images to rebuild.
In this phase, Freshmaker will search for cases when older image has different
parent than the newer image and if it finds such case, it will replace the
parents completely according to latest image, because we will in the end
use the latest image.
In our example, it will do following in this initial phase:
foo-1-1
has different parent than foo-1-2
.foo-1-2
is latest, and therefore it will change thefoo-1-1
parent of bar-1-1
to foo-1-2
, include its dependencyy-1-1
.After this initial phase, the bar-1-1
will have foo-1-2
dependency.
This will make Freshmaker to generate proper list of images to rebuild.
This is all about indentation to put all of this into the
for
loop. The code did not change in this part.