@@ -160,6 +160,17 @@ func Test_PhaseSort(t *testing.T) {
160160 },
161161 },
162162 },
163+ {
164+ Object : & unstructured.Unstructured {
165+ Object : map [string ]interface {}{
166+ "apiVersion" : "cert-manager.io/v1" ,
167+ "kind" : "Certificate" ,
168+ "metadata" : map [string ]interface {}{
169+ "name" : "test" ,
170+ },
171+ },
172+ },
173+ },
163174 {
164175 Object : & unstructured.Unstructured {
165176 Object : map [string ]interface {}{
@@ -309,6 +320,17 @@ func Test_PhaseSort(t *testing.T) {
309320 },
310321 },
311322 },
323+ {
324+ Object : & unstructured.Unstructured {
325+ Object : map [string ]interface {}{
326+ "apiVersion" : "cert-manager.io/v1" ,
327+ "kind" : "Certificate" ,
328+ "metadata" : map [string ]interface {}{
329+ "name" : "test" ,
330+ },
331+ },
332+ },
333+ },
312334 },
313335 },
314336 {
@@ -449,7 +471,7 @@ func Test_PhaseSort(t *testing.T) {
449471 want : []* ocv1ac.ClusterObjectSetPhaseApplyConfiguration {},
450472 },
451473 {
452- name : "sort by group within same phase " ,
474+ name : "sort by group across infrastructure and deploy phases " ,
453475 objs : []ocv1ac.ClusterObjectSetObjectApplyConfiguration {
454476 {
455477 Object : & unstructured.Unstructured {
@@ -476,24 +498,29 @@ func Test_PhaseSort(t *testing.T) {
476498 },
477499 want : []* ocv1ac.ClusterObjectSetPhaseApplyConfiguration {
478500 {
479- Name : ptr .To (string (applier .PhaseDeploy )),
501+ Name : ptr .To (string (applier .PhaseInfrastructure )),
480502 Objects : []ocv1ac.ClusterObjectSetObjectApplyConfiguration {
481503 {
482504 Object : & unstructured.Unstructured {
483505 Object : map [string ]interface {}{
484- "apiVersion" : "apps /v1" ,
485- "kind" : "Deployment " ,
506+ "apiVersion" : "cert-manager.io /v1" ,
507+ "kind" : "Certificate " ,
486508 "metadata" : map [string ]interface {}{
487509 "name" : "test" ,
488510 },
489511 },
490512 },
491513 },
514+ },
515+ },
516+ {
517+ Name : ptr .To (string (applier .PhaseDeploy )),
518+ Objects : []ocv1ac.ClusterObjectSetObjectApplyConfiguration {
492519 {
493520 Object : & unstructured.Unstructured {
494521 Object : map [string ]interface {}{
495- "apiVersion" : "cert-manager.io /v1" ,
496- "kind" : "Certificate " ,
522+ "apiVersion" : "apps /v1" ,
523+ "kind" : "Deployment " ,
497524 "metadata" : map [string ]interface {}{
498525 "name" : "test" ,
499526 },
0 commit comments