@@ -39,6 +39,7 @@ const (
39
39
40
40
func TestConfigMapUnpacker (t * testing.T ) {
41
41
pathHash := hash (bundlePath )
42
+ digestHash := hash (digestPath )
42
43
start := metav1 .Now ()
43
44
now := func () metav1.Time {
44
45
return start
@@ -404,13 +405,13 @@ func TestConfigMapUnpacker(t *testing.T) {
404
405
objs : []runtime.Object {
405
406
& batchv1.Job {
406
407
ObjectMeta : metav1.ObjectMeta {
407
- Name : hash ( digestPath ) ,
408
+ Name : digestHash ,
408
409
Namespace : "ns-a" ,
409
410
OwnerReferences : []metav1.OwnerReference {
410
411
{
411
412
APIVersion : "v1" ,
412
413
Kind : "ConfigMap" ,
413
- Name : hash ( digestPath ) ,
414
+ Name : digestHash ,
414
415
Controller : & blockOwnerDeletion ,
415
416
BlockOwnerDeletion : & blockOwnerDeletion ,
416
417
},
@@ -421,7 +422,7 @@ func TestConfigMapUnpacker(t *testing.T) {
421
422
BackoffLimit : & backoffLimit ,
422
423
Template : corev1.PodTemplateSpec {
423
424
ObjectMeta : metav1.ObjectMeta {
424
- Name : hash ( digestPath ) ,
425
+ Name : digestHash ,
425
426
},
426
427
Spec : corev1.PodSpec {
427
428
RestartPolicy : corev1 .RestartPolicyNever ,
@@ -436,7 +437,7 @@ func TestConfigMapUnpacker(t *testing.T) {
436
437
{
437
438
Name : "extract" ,
438
439
Image : opmImage ,
439
- Command : []string {"opm" , "alpha" , "bundle" , "extract" , "-m" , "/bundle/" , "-n" , "ns-a" , "-c" , hash ( digestPath ) , "-z" },
440
+ Command : []string {"opm" , "alpha" , "bundle" , "extract" , "-m" , "/bundle/" , "-n" , "ns-a" , "-c" , digestHash , "-z" },
440
441
Env : []corev1.EnvVar {
441
442
{
442
443
Name : configmap .EnvContainerImage ,
@@ -549,7 +550,7 @@ func TestConfigMapUnpacker(t *testing.T) {
549
550
},
550
551
& corev1.ConfigMap {
551
552
ObjectMeta : metav1.ObjectMeta {
552
- Name : hash ( digestPath ) ,
553
+ Name : digestHash ,
553
554
Namespace : "ns-a" ,
554
555
OwnerReferences : []metav1.OwnerReference {
555
556
{
@@ -608,7 +609,7 @@ func TestConfigMapUnpacker(t *testing.T) {
608
609
Name : "src-a" ,
609
610
},
610
611
},
611
- name : hash ( digestPath ) ,
612
+ name : digestHash ,
612
613
bundle : & api.Bundle {
613
614
CsvName : "etcdoperator.v0.9.2" ,
614
615
CsvJson : csvJSON + "\n " ,
@@ -623,7 +624,7 @@ func TestConfigMapUnpacker(t *testing.T) {
623
624
configMaps : []* corev1.ConfigMap {
624
625
{
625
626
ObjectMeta : metav1.ObjectMeta {
626
- Name : hash ( digestPath ) ,
627
+ Name : digestHash ,
627
628
Namespace : "ns-a" ,
628
629
Labels : map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue },
629
630
OwnerReferences : []metav1.OwnerReference {
@@ -647,13 +648,13 @@ func TestConfigMapUnpacker(t *testing.T) {
647
648
jobs : []* batchv1.Job {
648
649
{
649
650
ObjectMeta : metav1.ObjectMeta {
650
- Name : hash ( digestPath ) ,
651
+ Name : digestHash ,
651
652
Namespace : "ns-a" ,
652
653
OwnerReferences : []metav1.OwnerReference {
653
654
{
654
655
APIVersion : "v1" ,
655
656
Kind : "ConfigMap" ,
656
- Name : hash ( digestPath ) ,
657
+ Name : digestHash ,
657
658
Controller : & blockOwnerDeletion ,
658
659
BlockOwnerDeletion : & blockOwnerDeletion ,
659
660
},
@@ -664,7 +665,7 @@ func TestConfigMapUnpacker(t *testing.T) {
664
665
BackoffLimit : & backoffLimit ,
665
666
Template : corev1.PodTemplateSpec {
666
667
ObjectMeta : metav1.ObjectMeta {
667
- Name : hash ( digestPath ) ,
668
+ Name : digestHash ,
668
669
},
669
670
Spec : corev1.PodSpec {
670
671
RestartPolicy : corev1 .RestartPolicyNever ,
@@ -679,7 +680,7 @@ func TestConfigMapUnpacker(t *testing.T) {
679
680
{
680
681
Name : "extract" ,
681
682
Image : opmImage ,
682
- Command : []string {"opm" , "alpha" , "bundle" , "extract" , "-m" , "/bundle/" , "-n" , "ns-a" , "-c" , hash ( digestPath ) , "-z" },
683
+ Command : []string {"opm" , "alpha" , "bundle" , "extract" , "-m" , "/bundle/" , "-n" , "ns-a" , "-c" , digestHash , "-z" },
683
684
Env : []corev1.EnvVar {
684
685
{
685
686
Name : configmap .EnvContainerImage ,
@@ -794,13 +795,13 @@ func TestConfigMapUnpacker(t *testing.T) {
794
795
roles : []* rbacv1.Role {
795
796
{
796
797
ObjectMeta : metav1.ObjectMeta {
797
- Name : hash ( digestPath ) ,
798
+ Name : digestHash ,
798
799
Namespace : "ns-a" ,
799
800
OwnerReferences : []metav1.OwnerReference {
800
801
{
801
802
APIVersion : "v1" ,
802
803
Kind : "ConfigMap" ,
803
- Name : hash ( digestPath ) ,
804
+ Name : digestHash ,
804
805
Controller : & blockOwnerDeletion ,
805
806
BlockOwnerDeletion : & blockOwnerDeletion ,
806
807
},
@@ -818,7 +819,7 @@ func TestConfigMapUnpacker(t *testing.T) {
818
819
"configmaps" ,
819
820
},
820
821
ResourceNames : []string {
821
- hash ( digestPath ) ,
822
+ digestHash ,
822
823
},
823
824
},
824
825
},
@@ -827,13 +828,13 @@ func TestConfigMapUnpacker(t *testing.T) {
827
828
roleBindings : []* rbacv1.RoleBinding {
828
829
{
829
830
ObjectMeta : metav1.ObjectMeta {
830
- Name : hash ( digestPath ) ,
831
+ Name : digestHash ,
831
832
Namespace : "ns-a" ,
832
833
OwnerReferences : []metav1.OwnerReference {
833
834
{
834
835
APIVersion : "v1" ,
835
836
Kind : "ConfigMap" ,
836
- Name : hash ( digestPath ) ,
837
+ Name : digestHash ,
837
838
Controller : & blockOwnerDeletion ,
838
839
BlockOwnerDeletion : & blockOwnerDeletion ,
839
840
},
@@ -850,7 +851,7 @@ func TestConfigMapUnpacker(t *testing.T) {
850
851
RoleRef : rbacv1.RoleRef {
851
852
APIGroup : "rbac.authorization.k8s.io" ,
852
853
Kind : "Role" ,
853
- Name : hash ( digestPath ) ,
854
+ Name : digestHash ,
854
855
},
855
856
},
856
857
},
0 commit comments