Skip to content

Commit

Permalink
Merge pull request #215 from karelyatin/fix_gateway_default
Browse files Browse the repository at this point in the history
Fix default handling for EnableChassisAsGateway
  • Loading branch information
openshift-merge-bot[bot] committed Jan 31, 2024
2 parents def099a + 7488c24 commit 8bdccc6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/v1beta1/ovncontroller_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ type OVSExternalIDs struct {

// +kubebuilder:validation:Optional
// +kubebuilder:default=true
EnableChassisAsGateway bool `json:"enable-chassis-as-gateway"`
EnableChassisAsGateway *bool `json:"enable-chassis-as-gateway"`
}

// RbacConditionsSet - set the conditions for the rbac object
Expand Down
7 changes: 6 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/ovncontroller/configjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func ConfigJob(
envVars["OvnBridge"] = env.SetValue(instance.Spec.ExternalIDS.OvnBridge)
envVars["OvnRemote"] = env.SetValue(internalEndpoint)
envVars["OvnEncapType"] = env.SetValue(instance.Spec.ExternalIDS.OvnEncapType)
envVars["EnableChassisAsGateway"] = env.SetValue(fmt.Sprintf("%t", instance.Spec.ExternalIDS.EnableChassisAsGateway))
envVars["EnableChassisAsGateway"] = env.SetValue(fmt.Sprintf("%t", *instance.Spec.ExternalIDS.EnableChassisAsGateway))
envVars["PhysicalNetworks"] = env.SetValue(getPhysicalNetworks(instance))
envVars["OvnHostName"] = EnvDownwardAPI("spec.nodeName")

Expand Down
1 change: 1 addition & 0 deletions tests/functional/ovncontroller_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ var _ = Describe("OVNController controller", func() {

It("applies meaningful defaults", func() {
ovnController := GetOVNController(ovnControllerName)
Expect(*ovnController.Spec.ExternalIDS.EnableChassisAsGateway).To(Equal(true))
Expect(ovnController.Spec.ExternalIDS.OvnEncapType).To(Equal("geneve"))
Expect(ovnController.Spec.ExternalIDS.OvnBridge).To(Equal("br-int"))
Expect(ovnController.Spec.ExternalIDS.SystemID).To(Equal("random"))
Expand Down

0 comments on commit 8bdccc6

Please sign in to comment.