From 52a430d06a211db4579d6243a96d6d03d2c8fada Mon Sep 17 00:00:00 2001 From: Michael Burman Date: Mon, 11 Sep 2023 11:18:07 +0300 Subject: [PATCH] Add port override test --- .../construct_podtemplatespec_test.go | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkg/reconciliation/construct_podtemplatespec_test.go b/pkg/reconciliation/construct_podtemplatespec_test.go index 1fe5561f..d694fe2f 100644 --- a/pkg/reconciliation/construct_podtemplatespec_test.go +++ b/pkg/reconciliation/construct_podtemplatespec_test.go @@ -1471,6 +1471,32 @@ func TestPorts(t *testing.T) { openPorts: []int32{8080, 9000, 9042, 9103, 9142}, notOpen: []int32{8609, 9160}, }, + { + dc: &api.CassandraDatacenter{ + Spec: api.CassandraDatacenterSpec{ + ClusterName: "bob-override", + ServerType: "cassandra", + ServerVersion: "4.1.2", + PodTemplateSpec: &corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "cassandra", + Ports: []corev1.ContainerPort{ + { + Name: "mgmt-api-http", + ContainerPort: 8081, + }, + }, + }, + }, + }, + }, + }, + }, + openPorts: []int32{8081, 9000, 9042, 9103, 9142}, + notOpen: []int32{8080, 8609, 9160}, + }, { dc: &api.CassandraDatacenter{ Spec: api.CassandraDatacenterSpec{