Skip to content

Commit 0844b97

Browse files
author
Mikalai Radchuk
committed
Improve error about a missing installed bundle
Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 774ab74 commit 0844b97

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/resolution/variablesources/bundle_deployment_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ var _ = Describe("BundleDeploymentVariableSource", func() {
131131

132132
bdVariableSource := variablesources.NewBundleDeploymentVariableSource(bundleDeployments, testBundleList, &MockRequiredPackageSource{})
133133
_, err := bdVariableSource.GetVariables(context.Background())
134-
Expect(err.Error()).To(Equal("bundleImage \"quay.io/operatorhubio/prometheus@sha256:nonexistent\" not found"))
134+
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"`))
135135
})
136136
})

internal/resolution/variablesources/installed_package.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func MakeInstalledPackageVariables(
5050
// find corresponding bundle for the installed content
5151
resultSet := catalogfilter.Filter(allBundles, catalogfilter.WithBundleImage(bundleImage))
5252
if len(resultSet) == 0 {
53-
return nil, fmt.Errorf("bundleImage %q not found", bundleImage)
53+
return nil, fmt.Errorf("bundle with image %q not found in available catalogs but is currently installed via BundleDeployment %q", bundleImage, bundleDeployment.Name)
5454
}
5555

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

internal/resolution/variablesources/installed_package_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,6 @@ func TestMakeInstalledPackageVariables(t *testing.T) {
321321
},
322322
)
323323
assert.Nil(t, installedPackages)
324-
assert.ErrorContains(t, err, `bundleImage "registry.io/repo/[email protected]" not found`)
324+
assert.ErrorContains(t, err, `bundle with image "registry.io/repo/[email protected]" not found in available catalogs but is currently installed via BundleDeployment "test-bd"`)
325325
})
326326
}

0 commit comments

Comments
 (0)