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

Add sysprop driven XML tags to default solr.xml #636

Merged
merged 7 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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: 2 additions & 2 deletions controllers/solrcloud_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ func (r *SolrCloudReconciler) Reconcile(ctx context.Context, req ctrl.Request) (

if hasSolrXml {
// make sure the user-provided solr.xml is valid
if !strings.Contains(solrXml, "${hostPort:") {
if !(strings.Contains(solrXml, "${solr.port.advertise:") || strings.Contains(solrXml, "${hostPort:")) {
return requeueOrNot,
fmt.Errorf("custom solr.xml in ConfigMap %s must contain a placeholder for the 'hostPort' variable, such as <int name=\"hostPort\">${hostPort:80}</int>",
fmt.Errorf("custom solr.xml in ConfigMap %s must contain a placeholder for either 'solr.port.advertise', or its deprecated alternative 'hostPort', e.g. <int name=\"hostPort\">${solr.port.advertise:80}</int>",
providedConfigMapName)
}
// stored in the pod spec annotations on the statefulset so that we get a restart when solr.xml changes
Expand Down
37 changes: 20 additions & 17 deletions controllers/solrcloud_controller_backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@ var _ = FDescribe("SolrCloud controller - Backup Repositories", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"SOLR_PORT_ADVERTISE": "8983",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
foundEnv := statefulSet.Spec.Template.Spec.Containers[0].Env

Expand Down Expand Up @@ -150,12 +151,13 @@ var _ = FDescribe("SolrCloud controller - Backup Repositories", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + foundSolrCloud.HeadlessServiceName() + "." + foundSolrCloud.Namespace,
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"SOLR_LOG_LEVEL": "INFO",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + foundSolrCloud.HeadlessServiceName() + "." + foundSolrCloud.Namespace,
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"SOLR_PORT_ADVERTISE": "8983",
"SOLR_LOG_LEVEL": "INFO",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
foundEnv := found.Spec.Template.Spec.Containers[0].Env

Expand Down Expand Up @@ -204,12 +206,13 @@ var _ = FDescribe("SolrCloud controller - Backup Repositories", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + foundSolrCloud.HeadlessServiceName() + "." + foundSolrCloud.Namespace,
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"SOLR_LOG_LEVEL": "INFO",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + foundSolrCloud.HeadlessServiceName() + "." + foundSolrCloud.Namespace,
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"SOLR_PORT_ADVERTISE": "8983",
"SOLR_LOG_LEVEL": "INFO",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
foundEnv := found.Spec.Template.Spec.Containers[0].Env

Expand Down
77 changes: 42 additions & 35 deletions controllers/solrcloud_controller_externaldns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ var _ = FDescribe("SolrCloud controller - External DNS", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + "." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + "." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_PORT_ADVERTISE": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -177,11 +178,12 @@ var _ = FDescribe("SolrCloud controller - External DNS", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_PORT": "2000",
"SOLR_NODE_PORT": "2000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_PORT": "2000",
"SOLR_NODE_PORT": "2000",
"SOLR_PORT_ADVERTISE": "2000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "2000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -248,11 +250,12 @@ var _ = FDescribe("SolrCloud controller - External DNS", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + "." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + "." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_PORT_ADVERTISE": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -318,11 +321,12 @@ var _ = FDescribe("SolrCloud controller - External DNS", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_PORT_ADVERTISE": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -386,11 +390,12 @@ var _ = FDescribe("SolrCloud controller - External DNS", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + "." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + "." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_PORT_ADVERTISE": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -466,11 +471,12 @@ var _ = FDescribe("SolrCloud controller - External DNS", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace + ".svc." + testKubeDomain,
"SOLR_PORT": "2000",
"SOLR_NODE_PORT": "2000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace + ".svc." + testKubeDomain,
"SOLR_PORT": "2000",
"SOLR_NODE_PORT": "2000",
"SOLR_PORT_ADVERTISE": "2000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "2000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -531,11 +537,12 @@ var _ = FDescribe("SolrCloud controller - External DNS", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + "." + testDomain,
"SOLR_PORT": "2000",
"SOLR_NODE_PORT": "2000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + "." + testDomain,
"SOLR_PORT": "2000",
"SOLR_NODE_PORT": "2000",
"SOLR_PORT_ADVERTISE": "2000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "2000"}), "Incorrect pre-stop command")
Expand Down
77 changes: 42 additions & 35 deletions controllers/solrcloud_controller_ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ var _ = FDescribe("SolrCloud controller - Ingress", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": solrCloud.Namespace + "-$(POD_NAME)." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": solrCloud.Namespace + "-$(POD_NAME)." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_PORT_ADVERTISE": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -213,11 +214,12 @@ var _ = FDescribe("SolrCloud controller - Ingress", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "3000",
"SOLR_PORT_ADVERTISE": "3000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -292,11 +294,12 @@ var _ = FDescribe("SolrCloud controller - Ingress", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": solrCloud.Namespace + "-$(POD_NAME)." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": solrCloud.Namespace + "-$(POD_NAME)." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_PORT_ADVERTISE": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -369,11 +372,12 @@ var _ = FDescribe("SolrCloud controller - Ingress", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_PORT_ADVERTISE": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -446,11 +450,12 @@ var _ = FDescribe("SolrCloud controller - Ingress", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": solrCloud.Namespace + "-$(POD_NAME)." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": solrCloud.Namespace + "-$(POD_NAME)." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_PORT_ADVERTISE": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -519,11 +524,12 @@ var _ = FDescribe("SolrCloud controller - Ingress", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + ".svc." + testKubeDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.Namespace + ".svc." + testKubeDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_PORT_ADVERTISE": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down Expand Up @@ -595,11 +601,12 @@ var _ = FDescribe("SolrCloud controller - Ingress", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": solrCloud.Namespace + "-$(POD_NAME)." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": solrCloud.Namespace + "-$(POD_NAME)." + testDomain,
"SOLR_PORT": "3000",
"SOLR_NODE_PORT": "100",
"SOLR_PORT_ADVERTISE": "100",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
Expect(statefulSet.Spec.Template.Spec.Containers[0].Lifecycle.PreStop.Exec.Command).To(Equal([]string{"solr", "stop", "-p", "3000"}), "Incorrect pre-stop command")
Expand Down
41 changes: 22 additions & 19 deletions controllers/solrcloud_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,14 @@ var _ = FDescribe("SolrCloud controller - General", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_JAVA_MEM": "-Xmx4G",
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"SOLR_LOG_LEVEL": "DEBUG",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT) extra-opts",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace,
"SOLR_JAVA_MEM": "-Xmx4G",
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"SOLR_PORT_ADVERTISE": "8983",
"SOLR_LOG_LEVEL": "DEBUG",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT) extra-opts",
}
foundEnv := statefulSet.Spec.Template.Spec.Containers[0].Env
// Note that this check changes the variable foundEnv, so the values are no longer valid afterwards.
Expand Down Expand Up @@ -247,13 +248,14 @@ var _ = FDescribe("SolrCloud controller - General", func() {

Expect(statefulSet.Spec.Template.Spec.Containers).To(HaveLen(1), "Solr StatefulSet requires a container.")
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/test",
"SOLR_HOST": "$(POD_NAME).foo-solrcloud-headless.default",
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"GC_TUNE": "gc Options",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"SOLR_STOP_WAIT": strconv.FormatInt(testTerminationGracePeriodSeconds-5, 10),
"ZK_HOST": "host:7271/test",
"SOLR_HOST": "$(POD_NAME).foo-solrcloud-headless.default",
"SOLR_PORT": "8983",
"SOLR_NODE_PORT": "8983",
"SOLR_PORT_ADVERTISE": "8983",
"GC_TUNE": "gc Options",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"SOLR_STOP_WAIT": strconv.FormatInt(testTerminationGracePeriodSeconds-5, 10),
}
expectedStatefulSetLabels := util.MergeLabelsOrAnnotations(solrCloud.SharedLabelsWith(solrCloud.Labels), map[string]string{"technology": util.SolrCloudPVCTechnology})
expectedStatefulSetAnnotations := map[string]string{util.SolrZKConnectionStringAnnotation: "host:7271/test"}
Expand Down Expand Up @@ -438,11 +440,12 @@ var _ = FDescribe("SolrCloud controller - General", func() {

// Env Variable Tests
expectedEnvVars := map[string]string{
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace + ".svc." + testKubeDomain,
"SOLR_PORT": "2000",
"SOLR_NODE_PORT": "2000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
"ZK_HOST": "host:7271/",
"SOLR_HOST": "$(POD_NAME)." + solrCloud.HeadlessServiceName() + "." + solrCloud.Namespace + ".svc." + testKubeDomain,
"SOLR_PORT": "2000",
"SOLR_NODE_PORT": "2000",
"SOLR_PORT_ADVERTISE": "2000",
"SOLR_OPTS": "-DhostPort=$(SOLR_NODE_PORT)",
}
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
By("testing the Solr Common Service")
Expand Down
Loading
Loading