Skip to content

Bug 2090135: Propagate correct error message for an invalid index #5893

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

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/olm/operator/bundle/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (i *Install) setup(ctx context.Context) error {
// check if index image adopts File-Based Catalog or SQLite index image format
isFBCImage, err := fbcutil.IsFBC(ctx, i.IndexImageCatalogCreator.IndexImage)
if err != nil {
return fmt.Errorf("error in upgrading the bundle %q that was installed traditionally", i.IndexImageCatalogCreator.BundleImage)
return fmt.Errorf("error determining whether index %q is FBC or SQLite based: %v", i.IndexImageCatalogCreator.IndexImage, err)
}
i.IndexImageCatalogCreator.HasFBCLabel = isFBCImage

Expand Down
6 changes: 3 additions & 3 deletions internal/olm/operator/registry/index_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ func handleTraditionalUpgrade(ctx context.Context, indexImage string, bundleImag
// render the index image
originalDeclCfg, err := fbcutil.RenderRefs(ctx, []string{indexImage})
if err != nil {
return "", fmt.Errorf("error in rendering index %q", indexImage)
return "", fmt.Errorf("error rendering index %q", indexImage)
}

// render the bundle image
bundleDeclConfig, err := fbcutil.RenderRefs(ctx, []string{bundleImage})
if err != nil {
return "", fmt.Errorf("error in rendering index %q", bundleImage)
return "", fmt.Errorf("error rendering bundle image %q", bundleImage)
}

if len(bundleDeclConfig.Bundles) != 1 {
return "", errors.New("bundle image must have exactly one bundle")
return "", errors.New("rendered bundle must have exactly one bundle")
}

// search for the specific channel in which the upgrade needs to take place, and upgrade from the channel head
Expand Down