@@ -86,7 +86,7 @@ func Test_SimpleRevisionGenerator_GenerateRevisionFromHelmRelease(t *testing.T)
8686 "olm.operatorframework.io/package-name" : "my-package" ,
8787 },
8888 Labels : map [string ]string {
89- "olm.operatorframework.io/owner" : "test-123" ,
89+ "olm.operatorframework.io/owner-name " : "test-123" ,
9090 },
9191 },
9292 Spec : ocv1.ClusterExtensionRevisionSpec {
@@ -178,9 +178,9 @@ func Test_SimpleRevisionGenerator_GenerateRevision(t *testing.T) {
178178 rev , err := b .GenerateRevision (t .Context (), fstest.MapFS {}, ext , map [string ]string {}, map [string ]string {})
179179 require .NoError (t , err )
180180
181- t .Log ("by checking the olm.operatorframework.io/ owner label is set to the name of the ClusterExtension " )
181+ t .Log ("by checking the owner label is set correctly (owner- name) " )
182182 require .Equal (t , map [string ]string {
183- controllers . ClusterExtensionRevisionOwnerLabel : "test-extension" ,
183+ labels . OwnerNameKey : "test-extension" ,
184184 }, rev .Labels )
185185 t .Log ("by checking the revision number is 0" )
186186 require .Equal (t , int64 (0 ), rev .Spec .Revision )
@@ -288,13 +288,13 @@ func Test_SimpleRevisionGenerator_AppliesObjectLabelsAndRevisionAnnotations(t *t
288288 ManifestProvider : r ,
289289 }
290290
291- revAnnotations := map [string ]string {
291+ revisionAnnotations := map [string ]string {
292292 "other" : "value" ,
293293 }
294294
295295 rev , err := b .GenerateRevision (t .Context (), fstest.MapFS {}, & ocv1.ClusterExtension {}, map [string ]string {
296296 "some" : "value" ,
297- }, revAnnotations )
297+ }, revisionAnnotations )
298298 require .NoError (t , err )
299299 t .Log ("by checking the rendered objects contain the given object labels" )
300300 for _ , phase := range rev .Spec .Phases {
@@ -305,8 +305,8 @@ func Test_SimpleRevisionGenerator_AppliesObjectLabelsAndRevisionAnnotations(t *t
305305 }, revObj .Object .GetLabels ())
306306 }
307307 }
308- t .Log ("by checking the generated revision contain the given annotations" )
309- require .Equal (t , revAnnotations , rev .Annotations )
308+ t .Log ("by checking the generated revision contains the given annotations" )
309+ require .Equal (t , revisionAnnotations , rev .Annotations )
310310}
311311
312312func Test_SimpleRevisionGenerator_Failure (t * testing.T ) {
@@ -344,7 +344,7 @@ func TestBoxcutter_Apply(t *testing.T) {
344344 Name : "test-ext-1" ,
345345 UID : "rev-uid-1" ,
346346 Labels : map [string ]string {
347- controllers . ClusterExtensionRevisionOwnerLabel : ext .Name ,
347+ labels . OwnerNameKey : ext .Name ,
348348 },
349349 },
350350 Spec : ocv1.ClusterExtensionRevisionSpec {
@@ -400,10 +400,10 @@ func TestBoxcutter_Apply(t *testing.T) {
400400 makeRevisionFunc : func (ctx context.Context , bundleFS fs.FS , ext * ocv1.ClusterExtension , objectLabels , revisionAnnotations map [string ]string ) (* ocv1.ClusterExtensionRevision , error ) {
401401 return & ocv1.ClusterExtensionRevision {
402402 ObjectMeta : metav1.ObjectMeta {
403- Annotations : revisionAnnotations ,
404403 Labels : map [string ]string {
405- controllers . ClusterExtensionRevisionOwnerLabel : ext .Name ,
404+ labels . OwnerNameKey : ext .Name ,
406405 },
406+ Annotations : revisionAnnotations ,
407407 },
408408 Spec : ocv1.ClusterExtensionRevisionSpec {
409409 Phases : []ocv1.ClusterExtensionRevisionPhase {
@@ -787,15 +787,15 @@ func TestBoxcutter_Apply(t *testing.T) {
787787 },
788788 },
789789 {
790- name : "annotation-only update (same phases, different annotations )" ,
790+ name : "annotation update (same phases, different metadata )" ,
791791 mockBuilder : & mockBundleRevisionBuilder {
792792 makeRevisionFunc : func (ctx context.Context , bundleFS fs.FS , ext * ocv1.ClusterExtension , objectLabels , revisionAnnotations map [string ]string ) (* ocv1.ClusterExtensionRevision , error ) {
793793 return & ocv1.ClusterExtensionRevision {
794794 ObjectMeta : metav1.ObjectMeta {
795- Annotations : revisionAnnotations ,
796795 Labels : map [string ]string {
797- controllers . ClusterExtensionRevisionOwnerLabel : ext .Name ,
796+ labels . OwnerNameKey : ext .Name ,
798797 },
798+ Annotations : revisionAnnotations ,
799799 },
800800 Spec : ocv1.ClusterExtensionRevisionSpec {
801801 Phases : []ocv1.ClusterExtensionRevisionPhase {
@@ -830,7 +830,7 @@ func TestBoxcutter_Apply(t *testing.T) {
830830 labels .PackageNameKey : "test-package" ,
831831 },
832832 Labels : map [string ]string {
833- controllers . ClusterExtensionRevisionOwnerLabel : ext .Name ,
833+ labels . OwnerNameKey : ext .Name ,
834834 },
835835 },
836836 Spec : ocv1.ClusterExtensionRevisionSpec {
@@ -870,7 +870,7 @@ func TestBoxcutter_Apply(t *testing.T) {
870870 assert .Equal (t , "1.0.1" , rev .Annotations [labels .BundleVersionKey ])
871871 assert .Equal (t , "test-package" , rev .Annotations [labels .PackageNameKey ])
872872 // Verify owner label is still present
873- assert .Equal (t , ext .Name , rev .Labels [controllers . ClusterExtensionRevisionOwnerLabel ])
873+ assert .Equal (t , ext .Name , rev .Labels [labels . OwnerNameKey ])
874874 },
875875 },
876876 }
@@ -896,8 +896,8 @@ func TestBoxcutter_Apply(t *testing.T) {
896896
897897 // Execute
898898 revisionAnnotations := map [string ]string {}
899- if tc .name == "annotation-only update (same phases, different annotations )" {
900- // For annotation-only update test, pass NEW annotations
899+ if tc .name == "annotation update (same phases, different metadata )" {
900+ // For annotation update test, pass NEW metadata in annotations
901901 revisionAnnotations = map [string ]string {
902902 labels .BundleVersionKey : "1.0.1" ,
903903 labels .PackageNameKey : "test-package" ,
@@ -1045,7 +1045,7 @@ func TestBoxcutterStorageMigrator(t *testing.T) {
10451045
10461046// mockBundleRevisionBuilder is a mock implementation of the ClusterExtensionRevisionGenerator for testing.
10471047type mockBundleRevisionBuilder struct {
1048- makeRevisionFunc func (ctx context.Context , bundleFS fs.FS , ext * ocv1.ClusterExtension , objectLabels , revisionAnnotation map [string ]string ) (* ocv1.ClusterExtensionRevision , error )
1048+ makeRevisionFunc func (ctx context.Context , bundleFS fs.FS , ext * ocv1.ClusterExtension , objectLabels , revisionAnnotations map [string ]string ) (* ocv1.ClusterExtensionRevision , error )
10491049}
10501050
10511051func (m * mockBundleRevisionBuilder ) GenerateRevision (ctx context.Context , bundleFS fs.FS , ext * ocv1.ClusterExtension , objectLabels , revisionAnnotations map [string ]string ) (* ocv1.ClusterExtensionRevision , error ) {
@@ -1061,7 +1061,7 @@ func (m *mockBundleRevisionBuilder) GenerateRevisionFromHelmRelease(
10611061 ObjectMeta : metav1.ObjectMeta {
10621062 Name : "test-revision" ,
10631063 Labels : map [string ]string {
1064- controllers . ClusterExtensionRevisionOwnerLabel : ext .Name ,
1064+ labels . OwnerNameKey : ext .Name ,
10651065 },
10661066 },
10671067 Spec : ocv1.ClusterExtensionRevisionSpec {},
0 commit comments