Skip to content

Commit b40d20e

Browse files
authored
Merge branch 'main' into zk-initcontainer-shell-script
2 parents 5fac023 + ca9d3c5 commit b40d20e

20 files changed

Lines changed: 62 additions & 50 deletions

api/v1beta1/solrcloud_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const (
3737

3838
DefaultSolrReplicas = int32(3)
3939
DefaultSolrRepo = "library/solr"
40-
DefaultSolrVersion = "8.11"
40+
DefaultSolrVersion = "9.10.0"
4141
DefaultSolrJavaMem = "-Xms1g -Xmx2g"
4242
DefaultSolrOpts = ""
4343
DefaultSolrLogLevel = "INFO"
@@ -149,7 +149,8 @@ type SolrCloudSpec struct {
149149
SolrModules []string `json:"solrModules,omitempty"`
150150

151151
// List of paths in the Solr Docker image to load in the classpath.
152-
// Note: Solr Modules will be auto-loaded if specified in the "solrModules" property. There is no need to specify them here as well.
152+
// There is no need to include paths for Solr Modules already specified in the "solrModules" property, those paths will be added automatically.
153+
// Note that this setting has no effect on solrcloud clusters that rely on a user-provided solr.xml file.
153154
//
154155
//+optional
155156
AdditionalLibs []string `json:"additionalLibs,omitempty"`

config/crd/bases/solr.apache.org_solrclouds.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ spec:
8888
additionalLibs:
8989
description: |-
9090
List of paths in the Solr Docker image to load in the classpath.
91-
Note: Solr Modules will be auto-loaded if specified in the "solrModules" property. There is no need to specify them here as well.
91+
There is no need to include paths for Solr Modules already specified in the "solrModules" property, those paths will be added automatically.
92+
Note that this setting has no effect on solrcloud clusters that rely on a user-provided solr.xml file.
9293
items:
9394
type: string
9495
type: array

controllers/solrcloud_controller_basic_auth_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,11 @@ func expectBasicAuthConfigOnPodTemplateWithGomega(g Gomega, solrCloud *solrv1bet
324324
// if the zookeeperRef has ACLs set, verify the env vars were set correctly for this initContainer
325325
allACL, _ := solrCloud.Spec.ZookeeperRef.GetACLs()
326326
if allACL != nil {
327-
g.Expect(expInitContainer.Env).To(HaveLen(10), "Wrong number of env vars using ACLs and Basic Auth")
328-
g.Expect(expInitContainer.Env[len(expInitContainer.Env)-2].Name).To(Equal("SOLR_OPTS"), "Env var SOLR_OPTS is misplaced the Solr Pod env vars")
329-
g.Expect(expInitContainer.Env[len(expInitContainer.Env)-1].Name).To(Equal("SECURITY_JSON"), "Env var SECURITY_JSON is misplaced the Solr Pod env vars")
330-
testACLEnvVarsWithGomega(g, expInitContainer.Env[3:len(expInitContainer.Env)-2], true)
327+
g.Expect(expInitContainer.Env).To(HaveLen(11), "Wrong number of env vars using ACLs and Basic Auth")
328+
g.Expect(expInitContainer.Env[len(expInitContainer.Env)-3].Name).To(Equal("SOLR_OPTS"), "Env var SOLR_OPTS is misplaced among the initContainer env vars")
329+
g.Expect(expInitContainer.Env[len(expInitContainer.Env)-2].Name).To(Equal("SOLR_TOOL_OPTS"), "Env var SOLR_TOOL_OPTS is misplaced among the initContainer env vars")
330+
g.Expect(expInitContainer.Env[len(expInitContainer.Env)-1].Name).To(Equal("SECURITY_JSON"), "Env var SECURITY_JSON is misplaced among the initContainer env vars")
331+
testACLEnvVarsWithGomega(g, expInitContainer.Env[3:len(expInitContainer.Env)-3], true)
331332
} // else this ref not using ACLs
332333

333334
expectPutSecurityJsonInZkCmd(g, expInitContainer)

controllers/solrcloud_controller_zk_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,9 @@ var _ = FDescribe("SolrCloud controller - Zookeeper", func() {
583583
testPodEnvVariables(expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
584584

585585
expectedInitContainerEnvVars := map[string]string{
586-
"SOLR_ZK_OPTS": testSolrZKOpts,
587-
"SOLR_OPTS": "$(SOLR_ZK_OPTS) " + testSolrOpts,
588-
"ZKCLI_JVM_FLAGS": "-Dsolr.zk.opts=this",
586+
"SOLR_ZK_OPTS": testSolrZKOpts,
587+
"SOLR_OPTS": "$(SOLR_ZK_OPTS) " + testSolrOpts,
588+
"SOLR_TOOL_OPTS": "$(SOLR_ZK_OPTS) " + testSolrOpts,
589589
}
590590
testPodEnvVariables(expectedInitContainerEnvVars, statefulSet.Spec.Template.Spec.InitContainers[1].Env)
591591
})

controllers/util/solr_util.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ package util
1919

2020
import (
2121
"fmt"
22+
"sort"
23+
"strconv"
24+
"strings"
25+
2226
solr "github.com/apache/solr-operator/api/v1beta1"
2327
appsv1 "k8s.io/api/apps/v1"
2428
corev1 "k8s.io/api/core/v1"
@@ -28,9 +32,6 @@ import (
2832
"k8s.io/apimachinery/pkg/util/intstr"
2933
"k8s.io/utils/pointer"
3034
"k8s.io/utils/ptr"
31-
"sort"
32-
"strconv"
33-
"strings"
3435
)
3536

3637
const (
@@ -1236,6 +1237,9 @@ func generateZKInteractionInitContainer(solrCloud *solr.SolrCloud, solrCloudStat
12361237
envVars = append(envVars, corev1.EnvVar{
12371238
Name: "SOLR_OPTS",
12381239
Value: strings.Join(allSolrOpts, " "),
1240+
}, corev1.EnvVar{
1241+
Name: "SOLR_TOOL_OPTS",
1242+
Value: strings.Join(allSolrOpts, " "),
12391243
})
12401244
}
12411245

@@ -1251,9 +1255,6 @@ func generateZKInteractionInitContainer(solrCloud *solr.SolrCloud, solrCloudStat
12511255

12521256
if security != nil && security.SecurityJson != "" {
12531257
envVars = append(envVars, corev1.EnvVar{Name: "SECURITY_JSON", ValueFrom: security.SecurityJsonSrc})
1254-
if solrCloud.Spec.SolrZkOpts != "" {
1255-
envVars = append(envVars, corev1.EnvVar{Name: "ZKCLI_JVM_FLAGS", Value: solrCloud.Spec.SolrZkOpts})
1256-
}
12571258
cmd += cmdToPutSecurityJsonInZk()
12581259
}
12591260

dev-docs/e2e-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $ make e2e-tests TEST_SEED=89724023 SOLR_IMAGE=apache/solr-nightly:10.0.0-SNAPSH
4747
The default parallelism is `3`.
4848
- **SOLR_IMAGE** - The solr docker image label to use in the integration tests.
4949
It is recommended to use only supported versions for the Solr Operator version being tested.
50-
Default is `solr:8.11`.
50+
Default is `solr:9.10.0`.
5151
- **KUBERETES_VERSION** - A full Kubernetes version, starting with `v`, to use when creating the KinD Cluster.
5252
To find a list of all possible versions, check the [KinD Node Docker tags](https://hub.docker.com/r/kindest/node/tags).
5353
Default is `v1.26.6`.

docs/local_tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ After inspecting the status of you Kube cluster, you should see a deployment for
122122
To start a Solr Cloud cluster, we will create a yaml that will tell the Solr Operator what version of Solr Cloud to run, and how many nodes, with how much memory etc.
123123

124124
```bash
125-
# Create a 3-node cluster v8.11 with 300m Heap each:
125+
# Create a 3-node cluster v9.10.0 with 300m Heap each:
126126
helm install example-solr apache-solr/solr --version 0.10.0-prerelease \
127-
--set image.tag=8.11 \
127+
--set image.tag=9.10.0 \
128128
--set solrOptions.javaMemory="-Xms300m -Xmx300m" \
129129
--set addressability.external.method=Ingress \
130130
--set addressability.external.domainName="ing.local.domain" \
@@ -207,13 +207,13 @@ By default, the helm chart does not set the `replicas` field, so it is safe to u
207207
So we wish to upgrade to a newer Solr version:
208208

209209
```bash
210-
# Take note of the current version, which is 8.11.2
210+
# Take note of the current version
211211
curl -s http://default-example-solrcloud.ing.local.domain/solr/admin/info/system | grep solr-i
212212
213213
# Update the solrCloud configuration with the new version, keeping all previous settings and the number of nodes set by the autoscaler.
214214
helm upgrade example-solr apache-solr/solr --version 0.10.0-prerelease \
215215
--reuse-values \
216-
--set image.tag=8.7
216+
--set image.tag=9.10.0
217217
218218
# Click the 'Show all details" button in Admin UI and start hitting the "Refresh" button
219219
# See how the operator upgrades one pod at a time. Solr version is in the 'node' column

example/test_solrcloud.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
storage: "5Gi"
2929
replicas: 3
3030
solrImage:
31-
tag: "8.11"
31+
tag: "9.10.0"
3232
solrJavaMem: "-Xms1g -Xmx3g"
3333
solrModules:
3434
- jaegertracer-configurator

example/test_solrcloud_backuprepos.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ metadata:
2020
spec:
2121
replicas: 1
2222
solrImage:
23-
tag: "8.11"
23+
tag: "9.10.0"
2424
backupRepositories:
2525
# "Volume" repositories store backup data in a Kubernetes volume.
2626
- name: "volume_repository_1"

example/test_solrcloud_private_repo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ spec:
2121
replicas: 3
2222
solrImage:
2323
repository: myprivate-repo.jfrog.io/solr
24-
tag: "8.11"
24+
tag: "9.10.0"
2525
imagePullSecret: "k8s-docker-registry-secret"

0 commit comments

Comments
 (0)