Feature: pod affinity changes for OVN
Deploy OVN northd using the same pod affinity rules
used with the NB and SB statefulsets. Also change
default anti-affinity for NB and SB statefulsets
to requiredDuringSchedulingIgnoredDuringExecution
over preferredDuringSchedulingIgnoredDuringExecution
Change-Id: I844bbdc53fe10a8b8d9f017b9a3c68d93b695b98
Add unit tests to for OVN Anti-Affinity Rules
These unit tests go over all the statefulset and
deployment pods using the and make sure they are
all using the right anti-affinity rules.
Change-Id: I2c8b5bf7515040e715bdeed4410acf6656578133
diff --git a/roles/ovn/vars_test.go b/roles/ovn/vars_test.go
new file mode 100644
index 0000000..ee4d95b
--- /dev/null
+++ b/roles/ovn/vars_test.go
@@ -0,0 +1,39 @@
+package ovn
+
+import (
+ _ "embed"
+ "os"
+ "testing"
+
+ "github.com/goccy/go-yaml"
+ "github.com/stretchr/testify/require"
+
+ "github.com/vexxhost/atmosphere/internal/openstack_helm"
+ "github.com/vexxhost/atmosphere/internal/testutils"
+)
+
+var (
+ //go:embed vars/main.yml
+ varsFile []byte
+ vars Vars
+)
+
+type Vars struct {
+ openstack_helm.HelmValues `yaml:"_ovn_helm_values"`
+}
+
+func TestMain(m *testing.M) {
+ t := &testing.T{}
+ err := yaml.UnmarshalWithOptions(varsFile, &vars)
+ require.NoError(t, err)
+
+ code := m.Run()
+ os.Exit(code)
+}
+
+func TestHelmValues(t *testing.T) {
+ vals, err := openstack_helm.CoalescedHelmValues("../../charts/ovn", &vars.HelmValues)
+ require.NoError(t, err)
+
+ testutils.TestAllPodsHaveAntiAffinityType(t, vals)
+}