@@ -64,7 +64,7 @@ func TestClusterExtensionNonExistentPackage(t *testing.T) {
64
64
t .Log ("By running reconcile" )
65
65
res , err := reconciler .Reconcile (ctx , ctrl.Request {NamespacedName : extKey })
66
66
require .Equal (t , ctrl.Result {}, res )
67
- require .EqualError (t , err , fmt .Errorf ("no package \" %v \" found" , pkgName ). Error ( ))
67
+ require .EqualError (t , err , fmt .Sprintf ("no package %q found" , pkgName ))
68
68
69
69
t .Log ("By fetching updated cluster extension after reconcile" )
70
70
require .NoError (t , cl .Get (ctx , extKey , clusterExtension ))
@@ -78,7 +78,7 @@ func TestClusterExtensionNonExistentPackage(t *testing.T) {
78
78
require .NotNil (t , cond )
79
79
require .Equal (t , metav1 .ConditionFalse , cond .Status )
80
80
require .Equal (t , ocv1alpha1 .ReasonResolutionFailed , cond .Reason )
81
- require .Equal (t , fmt .Errorf ("no package \" %v \" found" , pkgName ). Error ( ), cond .Message )
81
+ require .Equal (t , fmt .Sprintf ("no package %q found" , pkgName ), cond .Message )
82
82
83
83
verifyInvariants (ctx , t , reconciler .Client , clusterExtension )
84
84
require .NoError (t , cl .DeleteAllOf (ctx , & ocv1alpha1.ClusterExtension {}))
@@ -106,7 +106,7 @@ func TestClusterExtensionNonExistentVersion(t *testing.T) {
106
106
t .Log ("By running reconcile" )
107
107
res , err := reconciler .Reconcile (ctx , ctrl.Request {NamespacedName : extKey })
108
108
require .Equal (t , ctrl.Result {}, res )
109
- require .EqualError (t , err , fmt .Errorf ( " no package \" %v \" matching version \" %v \" found" , pkgName , " 0.50.0"). Error ( ))
109
+ require .EqualError (t , err , fmt .Sprintf ( ` no package %q matching version " 0.50.0" found` , pkgName ))
110
110
111
111
t .Log ("By fetching updated cluster extension after reconcile" )
112
112
require .NoError (t , cl .Get (ctx , extKey , clusterExtension ))
@@ -120,7 +120,7 @@ func TestClusterExtensionNonExistentVersion(t *testing.T) {
120
120
require .NotNil (t , cond )
121
121
require .Equal (t , metav1 .ConditionFalse , cond .Status )
122
122
require .Equal (t , ocv1alpha1 .ReasonResolutionFailed , cond .Reason )
123
- require .Equal (t , fmt .Errorf ( " no package \" %v \" matching version \" %v \" found" , pkgName , " 0.50.0"). Error ( ), cond .Message )
123
+ require .Equal (t , fmt .Sprintf ( ` no package %q matching version " 0.50.0" found` , pkgName ), cond .Message )
124
124
cond = apimeta .FindStatusCondition (clusterExtension .Status .Conditions , ocv1alpha1 .TypeInstalled )
125
125
require .NotNil (t , cond )
126
126
require .Equal (t , metav1 .ConditionFalse , cond .Status )
@@ -272,7 +272,7 @@ func TestClusterExtensionVersionNoChannel(t *testing.T) {
272
272
t .Log ("By running reconcile" )
273
273
res , err := reconciler .Reconcile (ctx , ctrl.Request {NamespacedName : extKey })
274
274
require .Equal (t , ctrl.Result {}, res )
275
- require .EqualError (t , err , fmt .Errorf ("no package \" %v \" matching version \" %v \" in channel \" %v \" found" , pkgName , pkgVer , pkgChan ). Error ( ))
275
+ require .EqualError (t , err , fmt .Sprintf ("no package %q matching version %q in channel %q found" , pkgName , pkgVer , pkgChan ))
276
276
277
277
t .Log ("By fetching updated cluster extension after reconcile" )
278
278
require .NoError (t , cl .Get (ctx , extKey , clusterExtension ))
@@ -286,7 +286,7 @@ func TestClusterExtensionVersionNoChannel(t *testing.T) {
286
286
require .NotNil (t , cond )
287
287
require .Equal (t , metav1 .ConditionFalse , cond .Status )
288
288
require .Equal (t , ocv1alpha1 .ReasonResolutionFailed , cond .Reason )
289
- require .Equal (t , fmt .Errorf ("no package \" %v \" matching version \" %v \" in channel \" %v \" found" , pkgName , pkgVer , pkgChan ). Error ( ), cond .Message )
289
+ require .Equal (t , fmt .Sprintf ("no package %q matching version %q in channel %q found" , pkgName , pkgVer , pkgChan ), cond .Message )
290
290
cond = apimeta .FindStatusCondition (clusterExtension .Status .Conditions , ocv1alpha1 .TypeInstalled )
291
291
292
292
require .NotNil (t , cond )
@@ -320,7 +320,7 @@ func TestClusterExtensionNoChannel(t *testing.T) {
320
320
t .Log ("By running reconcile" )
321
321
res , err := reconciler .Reconcile (ctx , ctrl.Request {NamespacedName : extKey })
322
322
require .Equal (t , ctrl.Result {}, res )
323
- require .EqualError (t , err , fmt .Errorf ("no package \" %v \" in channel \" %v \" found" , pkgName , pkgChan ). Error ( ))
323
+ require .EqualError (t , err , fmt .Sprintf ("no package %q in channel %q found" , pkgName , pkgChan ))
324
324
325
325
t .Log ("By fetching updated cluster extension after reconcile" )
326
326
require .NoError (t , cl .Get (ctx , extKey , clusterExtension ))
@@ -334,7 +334,7 @@ func TestClusterExtensionNoChannel(t *testing.T) {
334
334
require .NotNil (t , cond )
335
335
require .Equal (t , metav1 .ConditionFalse , cond .Status )
336
336
require .Equal (t , ocv1alpha1 .ReasonResolutionFailed , cond .Reason )
337
- require .Equal (t , fmt .Errorf ("no package \" %v \" in channel \" %v \" found" , pkgName , pkgChan ). Error ( ), cond .Message )
337
+ require .Equal (t , fmt .Sprintf ("no package %q in channel %q found" , pkgName , pkgChan ), cond .Message )
338
338
cond = apimeta .FindStatusCondition (clusterExtension .Status .Conditions , ocv1alpha1 .TypeInstalled )
339
339
require .NotNil (t , cond )
340
340
require .Equal (t , metav1 .ConditionFalse , cond .Status )
@@ -369,7 +369,7 @@ func TestClusterExtensionNoVersion(t *testing.T) {
369
369
t .Log ("By running reconcile" )
370
370
res , err := reconciler .Reconcile (ctx , ctrl.Request {NamespacedName : extKey })
371
371
require .Equal (t , ctrl.Result {}, res )
372
- require .EqualError (t , err , fmt .Errorf ("no package \" %v \" matching version \" %v \" in channel \" %v \" found" , pkgName , pkgVer , pkgChan ). Error ( ))
372
+ require .EqualError (t , err , fmt .Sprintf ("no package %q matching version %q in channel %q found" , pkgName , pkgVer , pkgChan ))
373
373
374
374
t .Log ("By fetching updated cluster extension after reconcile" )
375
375
require .NoError (t , cl .Get (ctx , extKey , clusterExtension ))
@@ -383,7 +383,7 @@ func TestClusterExtensionNoVersion(t *testing.T) {
383
383
require .NotNil (t , cond )
384
384
require .Equal (t , metav1 .ConditionFalse , cond .Status )
385
385
require .Equal (t , ocv1alpha1 .ReasonResolutionFailed , cond .Reason )
386
- require .Equal (t , fmt .Errorf ("no package \" %v \" matching version \" %v \" in channel \" %v \" found" , pkgName , pkgVer , pkgChan ). Error ( ), cond .Message )
386
+ require .Equal (t , fmt .Sprintf ("no package %q matching version %q in channel %q found" , pkgName , pkgVer , pkgChan ), cond .Message )
387
387
cond = apimeta .FindStatusCondition (clusterExtension .Status .Conditions , ocv1alpha1 .TypeInstalled )
388
388
require .NotNil (t , cond )
389
389
require .Equal (t , metav1 .ConditionFalse , cond .Status )
0 commit comments