Repository navigation
Conversation
bf9f9ff to
8f2bd3d
Compare
…st-processor Addresses Sonar on #4055: cognitive complexity of postProcessEnvironment and nodes (java:S3776), an unnamed catch variable (java:S7467), and Thread.sleep polling in the cluster test (java:S2925), now an Awaitility wait.
4002992 to
381d8c8
Compare
…st-processor Addresses Sonar on #4055: cognitive complexity of postProcessEnvironment and nodes (java:S3776), an unnamed catch variable (java:S7467), and Thread.sleep polling in the cluster test (java:S2925), now an Awaitility wait.
381d8c8 to
d459148
Compare
…st-processor Addresses Sonar on #4055: cognitive complexity of postProcessEnvironment and nodes (java:S3776), an unnamed catch variable (java:S7467), and Thread.sleep polling in the cluster test (java:S2925), now an Awaitility wait.
|
Thanks for this refactor — moving both
I found a few compatibility issues and edge cases that would be good to address before merging: Findings to Address1. Relaxed property binding regression on
|
Addresses review feedback on #4055: - resolve the truststore password through a kebab-case placeholder, so truststore-password and *_REDIS_TRUSTSTORE_PASSWORD bind again, with the camelCase name as fallback for the executor secret files - map spring.data.redis.host/port only in standalone mode, so cluster and sentinel deployments start with a blank TerrakubeRedisPort - parse sentinel nodes only when a sentinel master is set, and never when cluster mode wins - send no username when it is blank, as the hand-written factories did - cover the truststore and sentinel password secret files in the executor
|
@alfespa17 thanks for the thorough review — addressed in ed33359:
Also fixed the whitespace-only The remaining notes (Sentinel/Cluster TLS hostname verification, bean renames, empty JKS password integrity check, release-notes items) are behavior we're keeping as-is; I'll carry the operator-impact points into the release notes. |
…iguration The API and the executor each built the Jedis connection factory, the trust store and the standalone/sentinel/cluster selection by hand. Boot now builds the connection from spring.data.redis.* and an SSL bundle. An EnvironmentPostProcessor per module maps the existing io.terrakube.*.redis.* properties (and the TerrakubeRedis* variables behind them) onto the Boot keys, so operator configuration is unchanged. Placeholders alone cannot do this: an empty sentinel or cluster key already switches Boot into that mode. Boot passes empty SSLParameters to Jedis, which turns off the hostname check Jedis applies by default, so a customizer sets endpoint identification to HTTPS again whenever Redis TLS is on. Behaviour changes: - A configured trust store that cannot be read, or has a wrong password, stops startup. It used to be logged and replaced by an empty store. - ssl=true without a trust store path uses the JVM default trust store. - A sentinel or cluster node that is not host:port stops startup with a message naming the property, instead of being skipped. - spring.data.redis.url, .sentinel.*, .cluster.* or .masterreplica.* set directly stops startup: Redis is configured only through the Terrakube properties. - The connection factory bean is Boot's (still a JedisConnectionFactory). Refs #4052
…-redirects 0
Cluster nodes are parsed with Spring Data's RedisNode again, so a node
without a port (default 6379) and bracketed IPv6 work as they did before
the move to Boot auto-configuration.
A cluster max-redirects of 0 or less is treated as not set. Jedis
rejects it ("Max attempts must be positive for cluster mode"), so
cluster mode could not start with the shipped default; a Testcontainers
test now starts a cluster with that default.
Node entries that look like URLs or have a port outside 1..65535 are
rejected, and the error names the property and the position without
echoing the entry, which could contain a password.
Refs #4052
The API and the executor carried near-identical copies of the Redis environment post-processor and connection configuration, because the modules had no shared code. A new library module, common, holds one implementation; each application keeps a thin subclass with its property prefix, pool mapping and order, and its own spring.factories entry. Builds that package a single module now pass -am so common is built first (release workflows, terrakubeBuild.sh, skill docs). The coverage aggregate and PR labels include the new module. The registry does not depend on it. Refs #4052
The API jar already ships a third-party common-0.13.0.jar, so the shared module's artifact is renamed to terrakube-common. jedis.version moves to the root pom so the module is always tested against the Jedis the applications ship. The shared Redis classes are abstract, so the shared configuration cannot be registered next to an application's subclass. The remaining single-module Maven commands in the skill docs and two javadocs now use -am. Refs #4052
…st-processor Addresses Sonar on #4055: cognitive complexity of postProcessEnvironment and nodes (java:S3776), an unnamed catch variable (java:S7467), and Thread.sleep polling in the cluster test (java:S2925), now an Awaitility wait.
Addresses review feedback on #4055: - resolve the truststore password through a kebab-case placeholder, so truststore-password and *_REDIS_TRUSTSTORE_PASSWORD bind again, with the camelCase name as fallback for the executor secret files - map spring.data.redis.host/port only in standalone mode, so cluster and sentinel deployments start with a blank TerrakubeRedisPort - parse sentinel nodes only when a sentinel master is set, and never when cluster mode wins - send no username when it is blank, as the hand-written factories did - cover the truststore and sentinel password secret files in the executor
ed33359 to
dfe552a
Compare
|



What changed and why?
Part 2 of #4052. Stacked on the Quartz pull request.
The API and the executor each built the Jedis connection factory, the trust store and the standalone / sentinel / cluster selection by hand, in two near-identical classes. Boot now builds the connection from
spring.data.redis.*and an SSL bundle.An
EnvironmentPostProcessorper module maps the existingio.terrakube.*.redis.*properties, and theTerrakubeRedis*variables behind them, onto the Boot keys, so operator configuration is unchanged. Placeholders alone cannot do this: an empty sentinel or cluster key already switches Boot into that mode.Boot passes empty
SSLParametersto Jedis, which turns off the hostname check Jedis applies by default. A customizer sets endpoint identification toHTTPSagain whenever Redis TLS is on.Behaviour changes:
ssl=truewithout a trust store path uses the JVM default trust store.host:portstops startup with a message naming the property, instead of being skipped.spring.data.redis.url,.sentinel.*,.cluster.*or.masterreplica.*set directly stops startup. Redis is configured only through the Terrakube properties.JedisConnectionFactory.Not covered: sentinel and cluster over TLS are checked at configuration level only, and the executor has no live TLS handshake test.
Testing