Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#1103 from averdagu/revert/…
Browse files Browse the repository at this point in the history
…nicMappings

Revert "[ovn-controller] Don't create ovn-controller if nicMappings empty"
  • Loading branch information
openshift-merge-bot[bot] authored Sep 26, 2024
2 parents 77167c9 + ba9d53e commit eee64b7
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 469 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ spec:
replicas: 1
dbType: SB
storageRequest: 10G
ovnController: {}
ovnNorthd:
replicas: 1
ovnController: {}
neutron:
template:
databaseInstance: openstack
Expand Down
17 changes: 0 additions & 17 deletions config/samples/nad_datacentre.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions pkg/openstack/ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,6 @@ func ReconcileOVNController(ctx context.Context, instance *corev1beta1.OpenStack
return false, err
}
return false, nil
} else if len(instance.Spec.Ovn.Template.OVNController.NicMappings) == 0 {
// If nicMappings is not configured there's no need to start ovn-controller
Log.Info("OVN Controller has no nicMappings configured, forcing ready condition to true.")
if _, err := EnsureDeleted(ctx, helper, OVNController); err != nil {
return false, err
}
return true, nil
}

ovnControllerSpec := &instance.Spec.Ovn.Template.OVNController
Expand Down
36 changes: 0 additions & 36 deletions tests/functional/ctlplane/openstackoperator_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1620,11 +1620,6 @@ var _ = Describe("OpenStackOperator controller", func() {
"dbType": "SB",
},
},
"ovnController": map[string]interface{}{
"nicMappings": map[string]interface{}{
"datacentre": "ospbr",
},
},
},
}
DeferCleanup(
Expand Down Expand Up @@ -1675,37 +1670,6 @@ var _ = Describe("OpenStackOperator controller", func() {
}, timeout, interval).Should(Succeed())
})

It("should remove ovn-controller if nicMappings are removed", func() {
// Update spec
Eventually(func(g Gomega) {
OSCtlplane := GetOpenStackControlPlane(names.OpenStackControlplaneName)
OSCtlplane.Spec.Ovn.Template.OVNController.NicMappings = nil
g.Expect(k8sClient.Update(ctx, OSCtlplane)).Should(Succeed())
}, timeout, interval).Should(Succeed())

// ovn services exist
Eventually(func(g Gomega) {
ovnNorthd := ovn.GetOVNNorthd(names.OVNNorthdName)
g.Expect(ovnNorthd).Should(Not(BeNil()))
}, timeout, interval).Should(Succeed())

// If nicMappings are not configured, ovnController shouldn't spawn
Eventually(func(g Gomega) {
instance := &ovnv1.OVNController{}
g.Expect(th.K8sClient.Get(th.Ctx, names.OVNControllerName, instance)).Should(Not(Succeed()))
}, timeout, interval).Should(Succeed())

Eventually(func(g Gomega) {
ovnDbServerNB := ovn.GetOVNDBCluster(names.OVNDbServerNBName)
g.Expect(ovnDbServerNB).Should(Not(BeNil()))
}, timeout, interval).Should(Succeed())

Eventually(func(g Gomega) {
ovnDbServerSB := ovn.GetOVNDBCluster(names.OVNDbServerSBName)
g.Expect(ovnDbServerSB).Should(Not(BeNil()))
}, timeout, interval).Should(Succeed())
})

It("should remove OVN resources on disable", func() {
Eventually(func(g Gomega) {
OSCtlplane := GetOpenStackControlPlane(names.OpenStackControlplaneName)
Expand Down
5 changes: 0 additions & 5 deletions tests/functional/ctlplane/openstackversion_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@ var _ = Describe("OpenStackOperator controller", func() {
"dbType": "SB",
},
},
"ovnController": map[string]interface{}{
"nicMappings": map[string]interface{}{
"datacentre": "ospbr",
},
},
},
}
DeferCleanup(
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit eee64b7

Please sign in to comment.