Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/operator-controller/applier/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ var (
PhaseInfrastructure: {
{Kind: "Service"},
{Kind: "Issuer", Group: "cert-manager.io"},
{Kind: "Certificate", Group: "cert-manager.io"},
},

PhaseDeploy: {
{Kind: "Certificate", Group: "cert-manager.io"},
{Kind: "Deployment", Group: "apps"},
},

Expand Down
39 changes: 33 additions & 6 deletions internal/operator-controller/applier/phase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ func Test_PhaseSort(t *testing.T) {
},
},
},
{
Object: &unstructured.Unstructured{
Object: map[string]interface{}{
"apiVersion": "cert-manager.io/v1",
"kind": "Certificate",
"metadata": map[string]interface{}{
"name": "test",
},
},
},
},
{
Object: &unstructured.Unstructured{
Object: map[string]interface{}{
Expand Down Expand Up @@ -314,6 +325,17 @@ func Test_PhaseSort(t *testing.T) {
},
},
},
{
Object: &unstructured.Unstructured{
Object: map[string]interface{}{
"apiVersion": "cert-manager.io/v1",
"kind": "Certificate",
"metadata": map[string]interface{}{
"name": "test",
},
},
},
},
},
},
{
Expand Down Expand Up @@ -454,7 +476,7 @@ func Test_PhaseSort(t *testing.T) {
want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{},
},
{
name: "sort by group within same phase",
name: "sort by group across infrastructure and deploy phases",
objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{
{
Object: &unstructured.Unstructured{
Expand All @@ -481,24 +503,29 @@ func Test_PhaseSort(t *testing.T) {
},
want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{
{
Name: ptr.To(string(applier.PhaseDeploy)),
Name: ptr.To(string(applier.PhaseInfrastructure)),
Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{
{
Object: &unstructured.Unstructured{
Object: map[string]interface{}{
"apiVersion": "apps/v1",
"kind": "Deployment",
"apiVersion": "cert-manager.io/v1",
"kind": "Certificate",
"metadata": map[string]interface{}{
"name": "test",
},
},
},
},
},
},
{
Name: ptr.To(string(applier.PhaseDeploy)),
Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{
{
Object: &unstructured.Unstructured{
Object: map[string]interface{}{
"apiVersion": "cert-manager.io/v1",
"kind": "Certificate",
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": map[string]interface{}{
"name": "test",
},
Expand Down