Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[ovn-controller] Don't create ovn-controller if nicMappings empty" #1103

Merged
Merged
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
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
Loading