Skip to content

Commit

Permalink
Merge pull request #1572 from aleskandro/mirror-release
Browse files Browse the repository at this point in the history
OCPBUGS-20474: Set ImportPolicy to PreserveOriginal to honor --keep-manifest-list when mirroring a payload to an image stream
  • Loading branch information
openshift-ci[bot] committed Oct 12, 2023
2 parents 1430170 + 8dfa2dc commit 0307852
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/cli/admin/release/mirror.go
Expand Up @@ -681,6 +681,10 @@ func (o *MirrorOptions) Run(ctx context.Context) error {
hasErrors := make(map[string]error)
maxPerIteration := 12

importMode := imagev1.ImportModeLegacy
if o.KeepManifestList {
importMode = imagev1.ImportModePreserveOriginal
}
for retries := 4; (len(remaining) > 0 || len(hasErrors) > 0) && retries > 0; {
if len(remaining) == 0 {
for _, mapping := range mappings {
Expand Down Expand Up @@ -712,6 +716,9 @@ func (o *MirrorOptions) Run(ctx context.Context) error {
To: &corev1.LocalObjectReference{
Name: mapping.Name,
},
ImportPolicy: imagev1.TagImportPolicy{
ImportMode: importMode,
},
})
if len(isi.Spec.Images) > maxPerIteration {
break
Expand Down

0 comments on commit 0307852

Please sign in to comment.