2727 featureFlagResource = v1beta1 .GroupVersion .WithResource ("featureflags" )
2828)
2929
30+ const invalidAPIVersionMsg = "invalid api version %s, expected %s"
31+
3032type SyncOption func (s * Sync )
3133
3234type Sync struct {
@@ -241,7 +243,7 @@ func commonHandler(obj interface{}, object types.NamespacedName, emitEvent Defau
241243 }
242244
243245 if u .GetAPIVersion () != apiVersion {
244- return fmt .Errorf ("invalid api version %s, expected %s" , u .GetAPIVersion (), apiVersion )
246+ return fmt .Errorf (invalidAPIVersionMsg , u .GetAPIVersion (), apiVersion )
245247 }
246248
247249 if u .GetName () == object .Name {
@@ -263,7 +265,7 @@ func updateFuncHandler(oldObj interface{}, newObj interface{}, object types.Name
263265 }
264266
265267 if ffOldObj .GetAPIVersion () != apiVersion {
266- return fmt .Errorf ("invalid api version %s, expected %s" , ffOldObj .GetAPIVersion (), apiVersion )
268+ return fmt .Errorf (invalidAPIVersionMsg , ffOldObj .GetAPIVersion (), apiVersion )
267269 }
268270
269271 ffNewObj , err := asUnstructured (newObj )
@@ -272,7 +274,7 @@ func updateFuncHandler(oldObj interface{}, newObj interface{}, object types.Name
272274 }
273275
274276 if ffNewObj .GetAPIVersion () != apiVersion {
275- return fmt .Errorf ("invalid api version %s, expected %s" , ffNewObj .GetAPIVersion (), apiVersion )
277+ return fmt .Errorf (invalidAPIVersionMsg , ffNewObj .GetAPIVersion (), apiVersion )
276278 }
277279
278280 if object .Name == ffNewObj .GetName () && ffOldObj .GetResourceVersion () != ffNewObj .GetResourceVersion () {
0 commit comments