Skip to content

Commit 4a94bc3

Browse files
author
Mikalai Radchuk
committed
Improve error about a missing installed bundle
Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 8c59a33 commit 4a94bc3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/resolution/variablesources/bundle_deployment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,6 @@ var _ = Describe("BundleDeploymentVariableSource", func() {
164164

165165
bdVariableSource := variablesources.NewBundleDeploymentVariableSource(operators, bundleDeployments, testBundleList, &MockRequiredPackageSource{})
166166
_, err := bdVariableSource.GetVariables(context.Background())
167-
Expect(err.Error()).To(Equal("bundleImage \"quay.io/operatorhubio/prometheus@sha256:nonexistent\" not found"))
167+
Expect(err.Error()).To(Equal(`bundle with image "quay.io/operatorhubio/prometheus@sha256:nonexistent" not found in available catalogs but is currently installed via BundleDeployment "prometheus"`))
168168
})
169169
})

internal/resolution/variablesources/installed_package.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func MakeInstalledPackageVariables(
6666
// find corresponding bundle for the installed content
6767
resultSet := catalogfilter.Filter(allBundles, catalogfilter.WithBundleImage(bundleImage))
6868
if len(resultSet) == 0 {
69-
return nil, fmt.Errorf("bundleImage %q not found", bundleImage)
69+
return nil, fmt.Errorf("bundle with image %q not found in available catalogs but is currently installed via BundleDeployment %q", bundleImage, bundleDeployment.Name)
7070
}
7171

7272
sort.SliceStable(resultSet, func(i, j int) bool {

internal/resolution/variablesources/installed_package_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,6 @@ func TestMakeInstalledPackageVariables(t *testing.T) {
385385
},
386386
)
387387
assert.Nil(t, installedPackages)
388-
assert.ErrorContains(t, err, `bundleImage "registry.io/repo/[email protected]" not found`)
388+
assert.ErrorContains(t, err, `bundle with image "registry.io/repo/[email protected]" not found in available catalogs but is currently installed via BundleDeployment "test-package-bd"`)
389389
})
390390
}

0 commit comments

Comments
 (0)