Skip to content

Commit

Permalink
OCPBUGS-21865: Honor IncludeChannel.MaxVersion when mirroring differe…
Browse files Browse the repository at this point in the history
…ntially (#761)
  • Loading branch information
sherine-k committed Dec 15, 2023
1 parent 338ea01 commit 83acc2a
Show file tree
Hide file tree
Showing 2 changed files with 519 additions and 2 deletions.
19 changes: 17 additions & 2 deletions pkg/operator/declcfg_to_includecfg.go
Expand Up @@ -162,14 +162,29 @@ func (s *packageStrategy) UpdateIncludeConfig(dc declcfg.DeclarativeConfig, prev
// Check if the package is new or has
// version configuration set at the package level
// if not process at the channel level.
icPkg, found := currPackages[mpkg.Name]
if !found || !includePackageVersionsSet(icPkg) {
icPkg, pkgFound := currPackages[mpkg.Name]
if !pkgFound || !includePackageVersionsSet(icPkg) {
prevPkg, found := prevPackages[mpkg.Name]
if !found {
chWithHeads, err := getChannelHeads(*mpkg)
if err != nil {
return ic, err
}
// OCPBUGS-21865: We need to keep the MaxVersion
// set by the user in the includeChannel, otherwise
// more bundles will be retrieved (up to the channel head)
if pkgFound { //put an upper bound on includeChannels
for _, c := range icPkg.Channels {
if c.MaxVersion == c.MinVersion {
for i, cwh := range chWithHeads {
if c.Name == cwh.Name {
cwh.MaxVersion = cwh.MinVersion
chWithHeads[i] = cwh
}
}
}
}
}
icPkg = v1alpha2.IncludePackage{
Name: mpkg.Name,
Channels: chWithHeads,
Expand Down

0 comments on commit 83acc2a

Please sign in to comment.