Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-21865: Honor IncludeChannel.MaxVersion when mirroring differe… #761

Merged
merged 1 commit into from Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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