diff --git a/internal/controllers/operator_controller_test.go b/internal/controllers/operator_controller_test.go index f769aa2b8..ef0a8f54c 100644 --- a/internal/controllers/operator_controller_test.go +++ b/internal/controllers/operator_controller_test.go @@ -83,7 +83,7 @@ var _ = Describe("Operator Controller Test", func() { By("running reconcile") res, err := reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: opKey}) Expect(res).To(Equal(ctrl.Result{})) - Expect(err).To(MatchError(fmt.Sprintf("no package '%s' found", pkgName))) + Expect(err).To(MatchError(fmt.Sprintf("no package %q found", pkgName))) By("fetching updated operator after reconcile") Expect(cl.Get(ctx, opKey, operator)).NotTo(HaveOccurred()) @@ -97,7 +97,7 @@ var _ = Describe("Operator Controller Test", func() { Expect(cond).NotTo(BeNil()) Expect(cond.Status).To(Equal(metav1.ConditionFalse)) Expect(cond.Reason).To(Equal(operatorsv1alpha1.ReasonResolutionFailed)) - Expect(cond.Message).To(Equal(fmt.Sprintf("no package '%s' found", pkgName))) + Expect(cond.Message).To(Equal(fmt.Sprintf("no package %q found", pkgName))) }) }) When("the operator specifies a version that does not exist", func() { @@ -119,7 +119,7 @@ var _ = Describe("Operator Controller Test", func() { By("running reconcile") res, err := reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: opKey}) Expect(res).To(Equal(ctrl.Result{})) - Expect(err).To(MatchError(fmt.Sprintf("no package '%s' matching version '0.50.0' found", pkgName))) + Expect(err).To(MatchError(fmt.Sprintf(`no package %q matching version "0.50.0" found`, pkgName))) By("fetching updated operator after reconcile") Expect(cl.Get(ctx, opKey, operator)).NotTo(HaveOccurred()) @@ -133,7 +133,7 @@ var _ = Describe("Operator Controller Test", func() { Expect(cond).NotTo(BeNil()) Expect(cond.Status).To(Equal(metav1.ConditionFalse)) Expect(cond.Reason).To(Equal(operatorsv1alpha1.ReasonResolutionFailed)) - Expect(cond.Message).To(Equal(fmt.Sprintf("no package '%s' matching version '0.50.0' found", pkgName))) + Expect(cond.Message).To(Equal(fmt.Sprintf(`no package %q matching version "0.50.0" found`, pkgName))) cond = apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeInstalled) Expect(cond).NotTo(BeNil()) Expect(cond.Status).To(Equal(metav1.ConditionUnknown)) @@ -765,7 +765,7 @@ var _ = Describe("Operator Controller Test", func() { By("running reconcile") res, err := reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: opKey}) Expect(res).To(Equal(ctrl.Result{})) - Expect(err).To(MatchError(fmt.Sprintf("no package '%s' matching version '%s' found in channel '%s'", pkgName, pkgVer, pkgChan))) + Expect(err).To(MatchError(fmt.Sprintf("no package %q matching version %q found in channel %q", pkgName, pkgVer, pkgChan))) By("fetching updated operator after reconcile") Expect(cl.Get(ctx, opKey, operator)).NotTo(HaveOccurred()) @@ -779,7 +779,7 @@ var _ = Describe("Operator Controller Test", func() { Expect(cond).NotTo(BeNil()) Expect(cond.Status).To(Equal(metav1.ConditionFalse)) Expect(cond.Reason).To(Equal(operatorsv1alpha1.ReasonResolutionFailed)) - Expect(cond.Message).To(Equal(fmt.Sprintf("no package '%s' matching version '%s' found in channel '%s'", pkgName, pkgVer, pkgChan))) + Expect(cond.Message).To(Equal(fmt.Sprintf("no package %q matching version %q found in channel %q", pkgName, pkgVer, pkgChan))) cond = apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeInstalled) Expect(cond).NotTo(BeNil()) Expect(cond.Status).To(Equal(metav1.ConditionUnknown)) @@ -808,7 +808,7 @@ var _ = Describe("Operator Controller Test", func() { By("running reconcile") res, err := reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: opKey}) Expect(res).To(Equal(ctrl.Result{})) - Expect(err).To(MatchError(fmt.Sprintf("no package '%s' found in channel '%s'", pkgName, pkgChan))) + Expect(err).To(MatchError(fmt.Sprintf("no package %q found in channel %q", pkgName, pkgChan))) By("fetching updated operator after reconcile") Expect(cl.Get(ctx, opKey, operator)).NotTo(HaveOccurred()) @@ -822,7 +822,7 @@ var _ = Describe("Operator Controller Test", func() { Expect(cond).NotTo(BeNil()) Expect(cond.Status).To(Equal(metav1.ConditionFalse)) Expect(cond.Reason).To(Equal(operatorsv1alpha1.ReasonResolutionFailed)) - Expect(cond.Message).To(Equal(fmt.Sprintf("no package '%s' found in channel '%s'", pkgName, pkgChan))) + Expect(cond.Message).To(Equal(fmt.Sprintf("no package %q found in channel %q", pkgName, pkgChan))) cond = apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeInstalled) Expect(cond).NotTo(BeNil()) Expect(cond.Status).To(Equal(metav1.ConditionUnknown)) @@ -854,7 +854,7 @@ var _ = Describe("Operator Controller Test", func() { By("running reconcile") res, err := reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: opKey}) Expect(res).To(Equal(ctrl.Result{})) - Expect(err).To(MatchError(fmt.Sprintf("no package '%s' matching version '%s' found in channel '%s'", pkgName, pkgVer, pkgChan))) + Expect(err).To(MatchError(fmt.Sprintf("no package %q matching version %q found in channel %q", pkgName, pkgVer, pkgChan))) By("fetching updated operator after reconcile") Expect(cl.Get(ctx, opKey, operator)).NotTo(HaveOccurred()) @@ -868,7 +868,7 @@ var _ = Describe("Operator Controller Test", func() { Expect(cond).NotTo(BeNil()) Expect(cond.Status).To(Equal(metav1.ConditionFalse)) Expect(cond.Reason).To(Equal(operatorsv1alpha1.ReasonResolutionFailed)) - Expect(cond.Message).To(Equal(fmt.Sprintf("no package '%s' matching version '%s' found in channel '%s'", pkgName, pkgVer, pkgChan))) + Expect(cond.Message).To(Equal(fmt.Sprintf("no package %q matching version %q found in channel %q", pkgName, pkgVer, pkgChan))) cond = apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeInstalled) Expect(cond).NotTo(BeNil()) Expect(cond.Status).To(Equal(metav1.ConditionUnknown)) diff --git a/internal/resolution/variablesources/operator.go b/internal/resolution/variablesources/operator.go index 06de4ec34..9e3f8ed42 100644 --- a/internal/resolution/variablesources/operator.go +++ b/internal/resolution/variablesources/operator.go @@ -32,19 +32,18 @@ func (o *OperatorVariableSource) GetVariables(ctx context.Context) ([]deppy.Vari variableSources = append(variableSources, o.inputVariableSource) } - // build required package variable sources - for _, operator := range o.operators { - rps, err := NewRequiredPackageVariableSource( - o.allBundles, - operator.Spec.PackageName, - InVersionRange(operator.Spec.Version), - InChannel(operator.Spec.Channel), - ) - if err != nil { - return nil, err - } - variableSources = append(variableSources, rps) + requiredPackages, err := MakeRequiredPackageVariables(o.allBundles, o.operators) + if err != nil { + return nil, err } - return variableSources.GetVariables(ctx) + variables, err := variableSources.GetVariables(ctx) + if err != nil { + return nil, err + } + + for _, v := range requiredPackages { + variables = append(variables, v) + } + return variables, nil } diff --git a/internal/resolution/variablesources/required_package.go b/internal/resolution/variablesources/required_package.go index 7fe6897f2..de735eb1c 100644 --- a/internal/resolution/variablesources/required_package.go +++ b/internal/resolution/variablesources/required_package.go @@ -1,99 +1,64 @@ package variablesources import ( - "context" "fmt" "sort" mmsemver "github.com/Masterminds/semver/v3" - "github.com/operator-framework/deppy/pkg/deppy" - "github.com/operator-framework/deppy/pkg/deppy/input" + operatorsv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1" "github.com/operator-framework/operator-controller/internal/catalogmetadata" catalogfilter "github.com/operator-framework/operator-controller/internal/catalogmetadata/filter" catalogsort "github.com/operator-framework/operator-controller/internal/catalogmetadata/sort" olmvariables "github.com/operator-framework/operator-controller/internal/resolution/variables" ) -var _ input.VariableSource = &RequiredPackageVariableSource{} +// MakeRequiredPackageVariables returns a variable which represent +// explicit requirement for a package from an user. +// This is when an user explicitly asks "install this" via Operator API. +func MakeRequiredPackageVariables(allBundles []*catalogmetadata.Bundle, operators []operatorsv1alpha1.Operator) ([]*olmvariables.RequiredPackageVariable, error) { + result := make([]*olmvariables.RequiredPackageVariable, 0, len(operators)) -type RequiredPackageVariableSourceOption func(*RequiredPackageVariableSource) error + for _, operator := range operators { + packageName := operator.Spec.PackageName + channelName := operator.Spec.Channel + versionRange := operator.Spec.Version -func InVersionRange(versionRange string) RequiredPackageVariableSourceOption { - return func(r *RequiredPackageVariableSource) error { - if versionRange != "" { - vr, err := mmsemver.NewConstraint(versionRange) - if err == nil { - r.versionRange = versionRange - r.predicates = append(r.predicates, catalogfilter.InMastermindsSemverRange(vr)) - return nil - } - - return fmt.Errorf("invalid version range '%s': %w", versionRange, err) + predicates := []catalogfilter.Predicate[catalogmetadata.Bundle]{ + catalogfilter.WithPackageName(packageName), } - return nil - } -} -func InChannel(channelName string) RequiredPackageVariableSourceOption { - return func(r *RequiredPackageVariableSource) error { if channelName != "" { - r.channelName = channelName - r.predicates = append(r.predicates, catalogfilter.InChannel(channelName)) + predicates = append(predicates, catalogfilter.InChannel(channelName)) } - return nil - } -} - -type RequiredPackageVariableSource struct { - allBundles []*catalogmetadata.Bundle - - packageName string - versionRange string - channelName string - predicates []catalogfilter.Predicate[catalogmetadata.Bundle] -} -func NewRequiredPackageVariableSource(allBundles []*catalogmetadata.Bundle, packageName string, options ...RequiredPackageVariableSourceOption) (*RequiredPackageVariableSource, error) { - if packageName == "" { - return nil, fmt.Errorf("package name must not be empty") - } - r := &RequiredPackageVariableSource{ - allBundles: allBundles, + if versionRange != "" { + vr, err := mmsemver.NewConstraint(versionRange) + if err != nil { + return nil, fmt.Errorf("invalid version range %q: %w", versionRange, err) + } + predicates = append(predicates, catalogfilter.InMastermindsSemverRange(vr)) + } - packageName: packageName, - predicates: []catalogfilter.Predicate[catalogmetadata.Bundle]{catalogfilter.WithPackageName(packageName)}, - } - for _, option := range options { - if err := option(r); err != nil { - return nil, err + resultSet := catalogfilter.Filter(allBundles, catalogfilter.And(predicates...)) + if len(resultSet) == 0 { + if versionRange != "" && channelName != "" { + return nil, fmt.Errorf("no package %q matching version %q found in channel %q", packageName, versionRange, channelName) + } + if versionRange != "" { + return nil, fmt.Errorf("no package %q matching version %q found", packageName, versionRange) + } + if channelName != "" { + return nil, fmt.Errorf("no package %q found in channel %q", packageName, channelName) + } + return nil, fmt.Errorf("no package %q found", packageName) } - } - return r, nil -} + sort.SliceStable(resultSet, func(i, j int) bool { + return catalogsort.ByVersion(resultSet[i], resultSet[j]) + }) -func (r *RequiredPackageVariableSource) GetVariables(_ context.Context) ([]deppy.Variable, error) { - resultSet := catalogfilter.Filter(r.allBundles, catalogfilter.And(r.predicates...)) - if len(resultSet) == 0 { - return nil, r.notFoundError() + result = append(result, olmvariables.NewRequiredPackageVariable(packageName, resultSet)) } - sort.SliceStable(resultSet, func(i, j int) bool { - return catalogsort.ByVersion(resultSet[i], resultSet[j]) - }) - return []deppy.Variable{ - olmvariables.NewRequiredPackageVariable(r.packageName, resultSet), - }, nil -} -func (r *RequiredPackageVariableSource) notFoundError() error { - if r.versionRange != "" && r.channelName != "" { - return fmt.Errorf("no package '%s' matching version '%s' found in channel '%s'", r.packageName, r.versionRange, r.channelName) - } - if r.versionRange != "" { - return fmt.Errorf("no package '%s' matching version '%s' found", r.packageName, r.versionRange) - } - if r.channelName != "" { - return fmt.Errorf("no package '%s' found in channel '%s'", r.packageName, r.channelName) - } - return fmt.Errorf("no package '%s' found", r.packageName) + return result, nil } diff --git a/internal/resolution/variablesources/required_package_test.go b/internal/resolution/variablesources/required_package_test.go index 27723938d..78ef98285 100644 --- a/internal/resolution/variablesources/required_package_test.go +++ b/internal/resolution/variablesources/required_package_test.go @@ -1,123 +1,194 @@ package variablesources_test import ( - "context" "encoding/json" "fmt" + "testing" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "github.com/operator-framework/deppy/pkg/deppy" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/operator-framework/deppy/pkg/deppy/constraint" + "github.com/operator-framework/deppy/pkg/deppy/input" "github.com/operator-framework/operator-registry/alpha/declcfg" "github.com/operator-framework/operator-registry/alpha/property" + operatorsv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1" "github.com/operator-framework/operator-controller/internal/catalogmetadata" olmvariables "github.com/operator-framework/operator-controller/internal/resolution/variables" "github.com/operator-framework/operator-controller/internal/resolution/variablesources" ) -var _ = Describe("RequiredPackageVariableSource", func() { - var ( - rpvs *variablesources.RequiredPackageVariableSource - bundleList []*catalogmetadata.Bundle - packageName string - ) - - BeforeEach(func() { - var err error - packageName = "test-package" - channel := catalogmetadata.Channel{Channel: declcfg.Channel{ - Name: "stable", - }} - bundleList = []*catalogmetadata.Bundle{ - {Bundle: declcfg.Bundle{ +func TestMakeRequiredPackageVariables(t *testing.T) { + stableChannel := catalogmetadata.Channel{Channel: declcfg.Channel{ + Name: "stable", + }} + betaChannel := catalogmetadata.Channel{Channel: declcfg.Channel{ + Name: "beta", + }} + bundleSet := map[string]*catalogmetadata.Bundle{ + // Bundles which belong to test-package we will be using + // to assert wether the testable function filters out the data + // correctly. + "test-package.v1.0.0": { + Bundle: declcfg.Bundle{ Name: "test-package.v1.0.0", Package: "test-package", Properties: []property.Property{ {Type: property.TypePackage, Value: json.RawMessage(`{"packageName": "test-package", "version": "1.0.0"}`)}, - }}, - InChannels: []*catalogmetadata.Channel{&channel}, + }, }, - {Bundle: declcfg.Bundle{ + InChannels: []*catalogmetadata.Channel{&stableChannel}, + }, + "test-package.v3.0.0": { + Bundle: declcfg.Bundle{ Name: "test-package.v3.0.0", Package: "test-package", Properties: []property.Property{ {Type: property.TypePackage, Value: json.RawMessage(`{"packageName": "test-package", "version": "3.0.0"}`)}, - }}, - InChannels: []*catalogmetadata.Channel{&channel}, + }, }, - {Bundle: declcfg.Bundle{ + InChannels: []*catalogmetadata.Channel{&stableChannel, &betaChannel}, + }, + "test-package.v2.0.0": { + Bundle: declcfg.Bundle{ Name: "test-package.v2.0.0", Package: "test-package", Properties: []property.Property{ {Type: property.TypePackage, Value: json.RawMessage(`{"packageName": "test-package", "version": "2.0.0"}`)}, - }}, - InChannels: []*catalogmetadata.Channel{&channel}, + }, }, - // add some bundles from a different package - {Bundle: declcfg.Bundle{ + InChannels: []*catalogmetadata.Channel{&stableChannel}, + }, + + // We need at least one bundle from different package + // to make sure that we are filtering it out. + "test-package-2.v1.0.0": { + Bundle: declcfg.Bundle{ Name: "test-package-2.v1.0.0", Package: "test-package-2", Properties: []property.Property{ {Type: property.TypePackage, Value: json.RawMessage(`{"packageName": "test-package-2", "version": "1.0.0"}`)}, - }}, - InChannels: []*catalogmetadata.Channel{&channel}, + }, }, - {Bundle: declcfg.Bundle{ - Name: "test-package-2.v2.0.0", - Package: "test-package-2", - Properties: []property.Property{ - {Type: property.TypePackage, Value: json.RawMessage(`{"packageName": "test-package-2", "version": "2.0.0"}`)}, - }}, - InChannels: []*catalogmetadata.Channel{&channel}, + InChannels: []*catalogmetadata.Channel{&stableChannel}, + }, + } + allBundles := make([]*catalogmetadata.Bundle, 0, len(bundleSet)) + for _, bundle := range bundleSet { + allBundles = append(allBundles, bundle) + } + + fakeOperator := func(packageName, channelName, versionRange string) operatorsv1alpha1.Operator { + return operatorsv1alpha1.Operator{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("op-%s-%s-%s", packageName, channelName, versionRange), + }, + Spec: operatorsv1alpha1.OperatorSpec{ + PackageName: packageName, + Version: versionRange, + Channel: channelName, }, } - rpvs, err = variablesources.NewRequiredPackageVariableSource(bundleList, packageName) - Expect(err).NotTo(HaveOccurred()) - }) - - It("should return the correct package variable", func() { - variables, err := rpvs.GetVariables(context.TODO()) - Expect(err).NotTo(HaveOccurred()) - Expect(variables).To(HaveLen(1)) - reqPackageVar, ok := variables[0].(*olmvariables.RequiredPackageVariable) - Expect(ok).To(BeTrue()) - Expect(reqPackageVar.Identifier()).To(Equal(deppy.IdentifierFromString(fmt.Sprintf("required package %s", packageName)))) - Expect(reqPackageVar.Bundles()).To(HaveLen(3)) - // ensure bundles are in version order (high to low) - Expect(reqPackageVar.Bundles()[0].Name).To(Equal("test-package.v3.0.0")) - Expect(reqPackageVar.Bundles()[1].Name).To(Equal("test-package.v2.0.0")) - Expect(reqPackageVar.Bundles()[2].Name).To(Equal("test-package.v1.0.0")) - }) - - It("should filter by version range", func() { - // recreate source with version range option - var err error - rpvs, err = variablesources.NewRequiredPackageVariableSource(bundleList, packageName, variablesources.InVersionRange(">=1.0.0 !=2.0.0 <3.0.0")) - Expect(err).NotTo(HaveOccurred()) - - variables, err := rpvs.GetVariables(context.TODO()) - Expect(err).NotTo(HaveOccurred()) - Expect(variables).To(HaveLen(1)) - reqPackageVar, ok := variables[0].(*olmvariables.RequiredPackageVariable) - Expect(ok).To(BeTrue()) - Expect(reqPackageVar.Identifier()).To(Equal(deppy.IdentifierFromString(fmt.Sprintf("required package %s", packageName)))) - - Expect(reqPackageVar.Bundles()).To(HaveLen(1)) - // test-package.v1.0.0 is the only package that matches the provided filter - Expect(reqPackageVar.Bundles()[0].Name).To(Equal("test-package.v1.0.0")) - }) + } - It("should fail with bad semver range", func() { - _, err := variablesources.NewRequiredPackageVariableSource(bundleList, packageName, variablesources.InVersionRange("not a valid semver")) - Expect(err).To(HaveOccurred()) - }) + for _, tt := range []struct { + name string + operators []operatorsv1alpha1.Operator + expectedResult []*olmvariables.RequiredPackageVariable + expectedError string + }{ + { + name: "package name only", + operators: []operatorsv1alpha1.Operator{ + fakeOperator("test-package", "", ""), + }, + expectedResult: []*olmvariables.RequiredPackageVariable{ + olmvariables.NewRequiredPackageVariable("test-package", []*catalogmetadata.Bundle{ + bundleSet["test-package.v3.0.0"], + bundleSet["test-package.v2.0.0"], + bundleSet["test-package.v1.0.0"], + }), + }, + }, + { + name: "package name and channel", + operators: []operatorsv1alpha1.Operator{ + fakeOperator("test-package", "beta", ""), + }, + expectedResult: []*olmvariables.RequiredPackageVariable{ + olmvariables.NewRequiredPackageVariable("test-package", []*catalogmetadata.Bundle{ + bundleSet["test-package.v3.0.0"], + }), + }, + }, + { + name: "package name and version range", + operators: []operatorsv1alpha1.Operator{ + fakeOperator("test-package", "", ">=1.0.0 !=2.0.0 <3.0.0"), + }, + expectedResult: []*olmvariables.RequiredPackageVariable{ + olmvariables.NewRequiredPackageVariable("test-package", []*catalogmetadata.Bundle{ + bundleSet["test-package.v1.0.0"], + }), + }, + }, + { + name: "package name and invalid version range", + operators: []operatorsv1alpha1.Operator{ + fakeOperator("test-package", "", "not a valid semver"), + }, + expectedError: `invalid version range "not a valid semver"`, + }, + { + name: "not found: package name only", + operators: []operatorsv1alpha1.Operator{ + fakeOperator("non-existent-test-package", "", ""), + }, + expectedError: `no package "non-existent-test-package" found`, + }, + { + name: "not found: package name and channel", + operators: []operatorsv1alpha1.Operator{ + fakeOperator("non-existent-test-package", "stable", ""), + }, + expectedError: `no package "non-existent-test-package" found in channel "stable"`, + }, + { + name: "not found: package name and version range", + operators: []operatorsv1alpha1.Operator{ + fakeOperator("non-existent-test-package", "", "1.0.0"), + }, + expectedError: `no package "non-existent-test-package" matching version "1.0.0" found`, + }, + { + name: "not found: package name with channel and version range", + operators: []operatorsv1alpha1.Operator{ + fakeOperator("non-existent-test-package", "stable", "1.0.0"), + }, + expectedError: `no package "non-existent-test-package" matching version "1.0.0" found in channel "stable"`, + }, + } { + t.Run(tt.name, func(t *testing.T) { + vars, err := variablesources.MakeRequiredPackageVariables(allBundles, tt.operators) + if tt.expectedError == "" { + assert.NoError(t, err) + } else { + assert.ErrorContains(t, err, tt.expectedError) + } - It("should return an error if package not found", func() { - rpvs, err := variablesources.NewRequiredPackageVariableSource([]*catalogmetadata.Bundle{}, packageName) - Expect(err).NotTo(HaveOccurred()) - _, err = rpvs.GetVariables(context.TODO()) - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError("no package 'test-package' found")) - }) -}) + gocmpopts := []cmp.Option{ + cmpopts.IgnoreUnexported(catalogmetadata.Bundle{}), + cmp.AllowUnexported( + olmvariables.RequiredPackageVariable{}, + input.SimpleVariable{}, + constraint.DependencyConstraint{}, + ), + } + require.Empty(t, cmp.Diff(vars, tt.expectedResult, gocmpopts...)) + }) + } +} diff --git a/test/e2e/install_test.go b/test/e2e/install_test.go index 5b80b711a..b25b740a4 100644 --- a/test/e2e/install_test.go +++ b/test/e2e/install_test.go @@ -155,7 +155,7 @@ var _ = Describe("Operator Install", func() { g.Expect(cond).ToNot(BeNil()) g.Expect(cond.Status).To(Equal(metav1.ConditionFalse)) g.Expect(cond.Reason).To(Equal(operatorv1alpha1.ReasonResolutionFailed)) - g.Expect(cond.Message).To(Equal(fmt.Sprintf("no package '%s' found", pkgName))) + g.Expect(cond.Message).To(Equal(fmt.Sprintf("no package %q found", pkgName))) }).Should(Succeed()) By("creating an Operator catalog with the desired package")