@@ -241,23 +241,23 @@ func TestExecutePlan(t *testing.T) {
241
241
Resource : v1alpha1.StepResource {
242
242
CatalogSource : "catalog" ,
243
243
CatalogSourceNamespace : namespace ,
244
- Group : "" ,
245
- Version : "v1" ,
246
- Kind : "Service" ,
247
- Name : "service" ,
248
- Manifest : toManifest (service ("service" , namespace )),
244
+ Group : "" ,
245
+ Version : "v1" ,
246
+ Kind : "Service" ,
247
+ Name : "service" ,
248
+ Manifest : toManifest (service ("service" , namespace )),
249
249
},
250
250
Status : v1alpha1 .StepStatusUnknown ,
251
251
},
252
252
{
253
253
Resource : v1alpha1.StepResource {
254
254
CatalogSource : "catalog" ,
255
255
CatalogSourceNamespace : namespace ,
256
- Group : "operators.coreos.com" ,
257
- Version : "v1alpha1" ,
258
- Kind : "ClusterServiceVersion" ,
259
- Name : "csv" ,
260
- Manifest : toManifest (csv ("csv" , namespace , nil , nil )),
256
+ Group : "operators.coreos.com" ,
257
+ Version : "v1alpha1" ,
258
+ Kind : "ClusterServiceVersion" ,
259
+ Name : "csv" ,
260
+ Manifest : toManifest (csv ("csv" , namespace , nil , nil )),
261
261
},
262
262
Status : v1alpha1 .StepStatusUnknown ,
263
263
},
@@ -330,6 +330,7 @@ func TestSyncCatalogSources(t *testing.T) {
330
330
Name : "cool-catalog" ,
331
331
Namespace : "cool-namespace" ,
332
332
UID : types .UID ("catalog-uid" ),
333
+ Labels : map [string ]string {"olm.catalogSource" : "cool-catalog" },
333
334
},
334
335
Spec : v1alpha1.CatalogSourceSpec {
335
336
Image : "catalog-image" ,
@@ -493,6 +494,7 @@ func TestSyncCatalogSources(t *testing.T) {
493
494
Name : "cool-catalog" ,
494
495
Namespace : "cool-namespace" ,
495
496
UID : types .UID ("catalog-uid" ),
497
+ Labels : map [string ]string {"olm.catalogSource" : "cool-catalog" },
496
498
},
497
499
Spec : v1alpha1.CatalogSourceSpec {
498
500
Image : "old-image" ,
@@ -898,50 +900,7 @@ func toManifest(obj runtime.Object) string {
898
900
}
899
901
900
902
func pod (s v1alpha1.CatalogSource ) * corev1.Pod {
901
- pod := & corev1.Pod {
902
- ObjectMeta : metav1.ObjectMeta {
903
- GenerateName : s .GetName () + "-" ,
904
- Namespace : s .GetNamespace (),
905
- Labels : map [string ]string {
906
- "olm.catalogSource" : s .GetName (),
907
- },
908
- },
909
- Spec : corev1.PodSpec {
910
- Containers : []corev1.Container {
911
- {
912
- Name : "registry-server" ,
913
- Image : s .Spec .Image ,
914
- Ports : []corev1.ContainerPort {
915
- {
916
- Name : "grpc" ,
917
- ContainerPort : 50051 ,
918
- },
919
- },
920
- ReadinessProbe : & corev1.Probe {
921
- Handler : corev1.Handler {
922
- Exec : & corev1.ExecAction {
923
- Command : []string {"grpc_health_probe" , "-addr=localhost:50051" },
924
- },
925
- },
926
- InitialDelaySeconds : 5 ,
927
- },
928
- LivenessProbe : & corev1.Probe {
929
- Handler : corev1.Handler {
930
- Exec : & corev1.ExecAction {
931
- Command : []string {"grpc_health_probe" , "-addr=localhost:50051" },
932
- },
933
- },
934
- InitialDelaySeconds : 10 ,
935
- },
936
- },
937
- },
938
- Tolerations : []corev1.Toleration {
939
- {
940
- Operator : corev1 .TolerationOpExists ,
941
- },
942
- },
943
- },
944
- }
903
+ pod := reconciler .Pod (& s , "registry-server" , s .Spec .Image , s .GetLabels (), 5 , 10 )
945
904
ownerutil .AddOwner (pod , & s , false , false )
946
905
return pod
947
906
}
0 commit comments