@@ -165,6 +165,17 @@ func Test_PhaseSort(t *testing.T) {
165165 },
166166 },
167167 },
168+ {
169+ Object : & unstructured.Unstructured {
170+ Object : map [string ]interface {}{
171+ "apiVersion" : "cert-manager.io/v1" ,
172+ "kind" : "Certificate" ,
173+ "metadata" : map [string ]interface {}{
174+ "name" : "test" ,
175+ },
176+ },
177+ },
178+ },
168179 {
169180 Object : & unstructured.Unstructured {
170181 Object : map [string ]interface {}{
@@ -314,6 +325,17 @@ func Test_PhaseSort(t *testing.T) {
314325 },
315326 },
316327 },
328+ {
329+ Object : & unstructured.Unstructured {
330+ Object : map [string ]interface {}{
331+ "apiVersion" : "cert-manager.io/v1" ,
332+ "kind" : "Certificate" ,
333+ "metadata" : map [string ]interface {}{
334+ "name" : "test" ,
335+ },
336+ },
337+ },
338+ },
317339 },
318340 },
319341 {
@@ -454,7 +476,7 @@ func Test_PhaseSort(t *testing.T) {
454476 want : []* ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration {},
455477 },
456478 {
457- name : "sort by group within same phase " ,
479+ name : "sort by group across infrastructure and deploy phases " ,
458480 objs : []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration {
459481 {
460482 Object : & unstructured.Unstructured {
@@ -481,24 +503,29 @@ func Test_PhaseSort(t *testing.T) {
481503 },
482504 want : []* ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration {
483505 {
484- Name : ptr .To (string (applier .PhaseDeploy )),
506+ Name : ptr .To (string (applier .PhaseInfrastructure )),
485507 Objects : []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration {
486508 {
487509 Object : & unstructured.Unstructured {
488510 Object : map [string ]interface {}{
489- "apiVersion" : "apps /v1" ,
490- "kind" : "Deployment " ,
511+ "apiVersion" : "cert-manager.io /v1" ,
512+ "kind" : "Certificate " ,
491513 "metadata" : map [string ]interface {}{
492514 "name" : "test" ,
493515 },
494516 },
495517 },
496518 },
519+ },
520+ },
521+ {
522+ Name : ptr .To (string (applier .PhaseDeploy )),
523+ Objects : []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration {
497524 {
498525 Object : & unstructured.Unstructured {
499526 Object : map [string ]interface {}{
500- "apiVersion" : "cert-manager.io /v1" ,
501- "kind" : "Certificate " ,
527+ "apiVersion" : "apps /v1" ,
528+ "kind" : "Deployment " ,
502529 "metadata" : map [string ]interface {}{
503530 "name" : "test" ,
504531 },
0 commit comments