Skip to content
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
4 changes: 4 additions & 0 deletions bindata/network/frr-k8s/node-status-cleaner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ metadata:
annotations:
release.openshift.io/version: "{{.ReleaseVersion}}"
spec:
{{- if .IsSNO }}
strategy:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be best to guard this by the isSNO variable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah thanks! Didn't know about its existance. I'll do that, although the effect of this change is a small window (during upgrades) where changes to CRDs are rejected, so I don't think it would hurt much in non - sno scenarios.

Anyways, adding it

type: Recreate
Comment thread
coderabbitai[bot] marked this conversation as resolved.
{{- end }}
selector:
matchLabels:
component: frr-k8s-statuscleaner
Expand Down
1 change: 1 addition & 0 deletions pkg/network/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ func renderAdditionalRoutingCapabilities(conf *operv1.NetworkSpec, bootstrapResu
data.Data["ReleaseVersion"] = os.Getenv("RELEASE_VERSION")
data.Data["NoOverlayManagedEnabled"] = conf.DefaultNetwork.OVNKubernetesConfig != nil &&
conf.DefaultNetwork.OVNKubernetesConfig.BGPManagedConfig.BGPTopology != ""
data.Data["IsSNO"] = bootstrapResult.OVN.ControlPlaneReplicaCount == 1
objs, err := render.RenderDir(filepath.Join(manifestDir, "network/frr-k8s"), &data)
if err != nil {
return nil, fmt.Errorf("failed to render frr-k8s manifests: %w", err)
Expand Down
31 changes: 31 additions & 0 deletions pkg/network/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,37 @@ func Test_renderFRRRoutingCapabilities(t *testing.T) {
})
}

func Test_renderFRRStatusCleanerStrategy(t *testing.T) {
frrConf := &operv1.NetworkSpec{
AdditionalRoutingCapabilities: &operv1.AdditionalRoutingCapabilities{
Providers: []operv1.RoutingCapabilitiesProvider{
operv1.RoutingCapabilitiesProviderFRR,
},
},
}

render := func(replicaCount int) *appsv1.Deployment {
g := NewWithT(t)
br := fakeBootstrapResult()
br.OVN.ControlPlaneReplicaCount = replicaCount
objs, err := renderAdditionalRoutingCapabilities(frrConf, br, manifestDir)
g.Expect(err).NotTo(HaveOccurred())
return mustFindRenderedObj[*appsv1.Deployment](t, objs, "Deployment", "frr-k8s-statuscleaner")
}

t.Run("SNO: strategy is Recreate", func(t *testing.T) {
g := NewWithT(t)
d := render(1)
g.Expect(d.Spec.Strategy.Type).To(Equal(appsv1.RecreateDeploymentStrategyType))
})

t.Run("HA: no strategy override", func(t *testing.T) {
g := NewWithT(t)
d := render(3)
g.Expect(d.Spec.Strategy.Type).To(BeEmpty())
})
}

func Test_renderNetworkingConsolePlugin(t *testing.T) {
renderAndFindNginxConfig := func(t *testing.T, tlsProfile bootstrap.TLSProfile) string {
g := NewWithT(t)
Expand Down