Closed hallyn closed 8 months ago
I recently hit this in the context of stacker publish
failing to publish after a successful build, and running with --debug
points to the flag wasLegacyImport
being different in the cache vs what the publish command saw:
It looks like by the time the cache is updated from the build, the correct value of the wasLegacyImport
flag has been lost. The stacker.yaml in question here did have the old import
syntax, and this instance of the bug goes away if we just fix the syntax in the stacker.yaml.
[2024-03-20T01:23:45.628Z] cached: types.Layer{From:types.ImageSource{Type:"built", Url:"", Tag:"minbase", Insecure:false}, ...snip ... Annotations:map[string]string(nil), OS:(*string)(0xc000ab7320), Arch:(*string)(0xc000ab7330), Bom:(*types.Bom)(nil),
wasLegacyImport:false}
[2024-03-20T01:23:45.631Z] new: types.Layer{From:types.ImageSource{Type:"built", Url:"", Tag:"minbase", Insecure:false}, ...snip ... Annotations:map[string]string(nil), OS:(*string)(0xc000591e60), Arch:(*string)(0xc000591e70), Bom:(*types.Bom)(nil),
wasLegacyImport:true}
[2024-03-20T01:23:45.632Z] cache miss because layer definition was changed
(This bug was found by @ariel-miculas and @andaaron was the one who guessed at the 'import' being the problem)
stacker version
v1.0.0-rc11
Describe the bug
'import:' in stacker.yaml has been replaced by 'imports:'. Those files end up under /stacker/imports/ instead of directly under /stacker. In order to provide some backward compatible support as users switch over, there is fallback support for 'import:' which is scheduled to be removed in the future.
This support however breaks mysteriously when using the 'prerequisites' feature.
To reproduce
Expected behavior
When the two stackerfiles are combined into one, the build succeeds:
Screenshots
No response
Additional context
No response