Skip to content

Commit

Permalink
Revert "[ovn-controller] Don't create ovn-controller if nicMappings e…
Browse files Browse the repository at this point in the history
…mpty"

This reverts commit a02a159.

This change created a bug on the adoption where all the gates reaches TIME_OUT,
reverting this patch to unblock prod chain while fixing it.

The problem that this patch was introducing was that edpm deployment expects
a config map created by ovn-operator (ovncontroller) called ovncontroller-config.
With this patch the ovncontroller CR was not created and the ovn-operator was
not reconciling this object, which was needed to create the said config map.

Related: OSPRH-7463
Related: OSPCIX-504
  • Loading branch information
averdagu committed Sep 26, 2024
1 parent 77167c9 commit ba9d53e
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 ba9d53e

Please sign in to comment.