@@ -228,23 +228,23 @@ func TestExecutePlan(t *testing.T) {
228
228
Resource : v1alpha1.StepResource {
229
229
CatalogSource : "catalog" ,
230
230
CatalogSourceNamespace : namespace ,
231
- Group : "" ,
232
- Version : "v1" ,
233
- Kind : "Service" ,
234
- Name : "service" ,
235
- Manifest : toManifest (service ("service" , namespace )),
231
+ Group : "" ,
232
+ Version : "v1" ,
233
+ Kind : "Service" ,
234
+ Name : "service" ,
235
+ Manifest : toManifest (service ("service" , namespace )),
236
236
},
237
237
Status : v1alpha1 .StepStatusUnknown ,
238
238
},
239
239
{
240
240
Resource : v1alpha1.StepResource {
241
241
CatalogSource : "catalog" ,
242
242
CatalogSourceNamespace : namespace ,
243
- Group : "operators.coreos.com" ,
244
- Version : "v1alpha1" ,
245
- Kind : "ClusterServiceVersion" ,
246
- Name : "csv" ,
247
- Manifest : toManifest (csv ("csv" , namespace , nil , nil )),
243
+ Group : "operators.coreos.com" ,
244
+ Version : "v1alpha1" ,
245
+ Kind : "ClusterServiceVersion" ,
246
+ Name : "csv" ,
247
+ Manifest : toManifest (csv ("csv" , namespace , nil , nil )),
248
248
},
249
249
Status : v1alpha1 .StepStatusUnknown ,
250
250
},
@@ -317,6 +317,7 @@ func TestSyncCatalogSources(t *testing.T) {
317
317
Name : "cool-catalog" ,
318
318
Namespace : "cool-namespace" ,
319
319
UID : types .UID ("catalog-uid" ),
320
+ Labels : map [string ]string {"olm.catalogSource" : "cool-catalog" },
320
321
},
321
322
Spec : v1alpha1.CatalogSourceSpec {
322
323
Image : "catalog-image" ,
@@ -480,6 +481,7 @@ func TestSyncCatalogSources(t *testing.T) {
480
481
Name : "cool-catalog" ,
481
482
Namespace : "cool-namespace" ,
482
483
UID : types .UID ("catalog-uid" ),
484
+ Labels : map [string ]string {"olm.catalogSource" : "cool-catalog" },
483
485
},
484
486
Spec : v1alpha1.CatalogSourceSpec {
485
487
Image : "old-image" ,
@@ -885,50 +887,7 @@ func toManifest(obj runtime.Object) string {
885
887
}
886
888
887
889
func pod (s v1alpha1.CatalogSource ) * corev1.Pod {
888
- pod := & corev1.Pod {
889
- ObjectMeta : metav1.ObjectMeta {
890
- GenerateName : s .GetName () + "-" ,
891
- Namespace : s .GetNamespace (),
892
- Labels : map [string ]string {
893
- "olm.catalogSource" : s .GetName (),
894
- },
895
- },
896
- Spec : corev1.PodSpec {
897
- Containers : []corev1.Container {
898
- {
899
- Name : "registry-server" ,
900
- Image : s .Spec .Image ,
901
- Ports : []corev1.ContainerPort {
902
- {
903
- Name : "grpc" ,
904
- ContainerPort : 50051 ,
905
- },
906
- },
907
- ReadinessProbe : & corev1.Probe {
908
- Handler : corev1.Handler {
909
- Exec : & corev1.ExecAction {
910
- Command : []string {"grpc_health_probe" , "-addr=localhost:50051" },
911
- },
912
- },
913
- InitialDelaySeconds : 5 ,
914
- },
915
- LivenessProbe : & corev1.Probe {
916
- Handler : corev1.Handler {
917
- Exec : & corev1.ExecAction {
918
- Command : []string {"grpc_health_probe" , "-addr=localhost:50051" },
919
- },
920
- },
921
- InitialDelaySeconds : 10 ,
922
- },
923
- },
924
- },
925
- Tolerations : []corev1.Toleration {
926
- {
927
- Operator : corev1 .TolerationOpExists ,
928
- },
929
- },
930
- },
931
- }
890
+ pod := reconciler .Pod (& s , "registry-server" , s .Spec .Image , s .GetLabels (), 5 , 10 )
932
891
ownerutil .AddOwner (pod , & s , false , false )
933
892
return pod
934
893
}
0 commit comments