Describe what should be investigated or refactored
Currently the LayersFromRequestedComponents flow is not well tested and brittle as it is used in a single location only under certain conditions. This should minimally be wrapped with unit tests, though ideally the flow should be redesigned to use more common code and allow for better calculation of what resources need to be pulled.
This came up during the fixing of a related bug (#2087 ) / change to the way image annotations are handled and may also lead into a simplification of the oci package as well.
Describe what should be investigated or refactored
Currently the
LayersFromRequestedComponents
flow is not well tested and brittle as it is used in a single location only under certain conditions. This should minimally be wrapped with unit tests, though ideally the flow should be redesigned to use more common code and allow for better calculation of what resources need to be pulled.Links to any relevant code
https://github.com/defenseunicorns/zarf/blob/7cc12011f863d48168202a4a4e2fb60e501cb560/src/pkg/oci/pull.go#L80
Additional context
This came up during the fixing of a related bug (#2087 ) / change to the way image annotations are handled and may also lead into a simplification of the
oci
package as well.