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
Operator doesn't pass on system property 'jgroups.dns.query' to Keycloak but an env variable, leading to a warning in the log #21830
Labels
Milestone
Comments
ahus1
changed the title
Operator doesn't pass on system property 'jgroups.dns.query' to Keycloak
Operator doesn't pass on system property 'jgroups.dns.query' to Keycloak but an env variable, leading to a warning in the log
Jul 19, 2023
shawkins
added a commit
to shawkins/keycloak
that referenced
this issue
Oct 17, 2023
shawkins
added a commit
to shawkins/keycloak
that referenced
this issue
Oct 17, 2023
shawkins
added a commit
to shawkins/keycloak
that referenced
this issue
Oct 17, 2023
shawkins
added a commit
to shawkins/keycloak
that referenced
this issue
Oct 17, 2023
shawkins
added a commit
to shawkins/keycloak
that referenced
this issue
Oct 18, 2023
shawkins
added a commit
to shawkins/keycloak
that referenced
this issue
Oct 18, 2023
shawkins
added a commit
to shawkins/keycloak
that referenced
this issue
Oct 18, 2023
shawkins
added a commit
to shawkins/keycloak
that referenced
this issue
Oct 18, 2023
shawkins
added a commit
to shawkins/keycloak
that referenced
this issue
Oct 19, 2023
vmuzikar
pushed a commit
that referenced
this issue
Oct 20, 2023
* fix: moves jgroups.dns.query to a system property closes #21830 * removing the dns query from import * removing the dns query from import also removing cache-stack
edewit
pushed a commit
to edewit/keycloak
that referenced
this issue
Oct 23, 2023
* fix: moves jgroups.dns.query to a system property closes keycloak#21830 * removing the dns query from import * removing the dns query from import also removing cache-stack
Yang-Xie-OSS
pushed a commit
to Hitachi/keycloak
that referenced
this issue
Nov 21, 2023
* fix: moves jgroups.dns.query to a system property closes keycloak#21830 * removing the dns query from import * removing the dns query from import also removing cache-stack
Yang-Xie-OSS
pushed a commit
to Hitachi/keycloak
that referenced
this issue
Nov 22, 2023
* fix: moves jgroups.dns.query to a system property closes keycloak#21830 * removing the dns query from import * removing the dns query from import also removing cache-stack
srose
pushed a commit
to srose/keycloak
that referenced
this issue
Dec 20, 2023
* fix: moves jgroups.dns.query to a system property closes keycloak#21830 * removing the dns query from import * removing the dns query from import also removing cache-stack
kamontat
pushed a commit
to kamontat/keycloak
that referenced
this issue
Jan 20, 2024
* fix: moves jgroups.dns.query to a system property closes keycloak#21830 * removing the dns query from import * removing the dns query from import also removing cache-stack Signed-off-by: Kamontat Chantrachirathumrong <14089557+kamontat@users.noreply.github.com>
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Before reporting an issue
Area
operator
Describe the bug
To configure discovery for Infinispan on Kubernetes, the docs as for the
jgroups.dns.query
to be added as a Java System Property using-D...
. Instead the Operator passes an environment variable which leads to a warning.Version
main
Expected behavior
No warning logged.
Actual behavior
Warning logged by Infinispan, which is misleading and wrong, as it is evaluated by JGroups in a second step:
This is what is happening:
The Keycloak Operator set an environment variable
jgroups.dns.query
:keycloak/operator/src/main/java/org/keycloak/operator/controllers/KeycloakDeployment.java
Lines 350 to 353 in fa83034
The environment variable is not visible inside of a shell, as shells ignore environment variable names which contain a dot. It is still there when I look at /proc/1/environ, and the Java process picks it up as it is started directly, and not from a shell.
After some debugging with @ryanemerson I found that Infinispan's
StringPropertyReplacer
doesn't look at environment variables and prints the warning, while JGroup'sProtocolConfiguration.substituteVariables
callsUtil.substituteVariable()
which then takes into account the environment variables as well.How to Reproduce?
Look at the logs of Keycloak started by the Operator in Kubernetes.
Anything else?
Looking at the JavaDoc of
StringPropertyReplacer
, environment variables need to be prefixed byenv.
to be replaced by Infinispan.As we're using the default stacks and don't want to duplicate them, we can't use an environment variable.
The JAVA_OPTS shouldn't be overwritten, as it would overwrite all defaults in
kc.sh
. TheJAVA_OPTS_APPEND
is usually overwritten using thepodTemplate
, so if the Operator wants to use that path, it should only append that option there.The text was updated successfully, but these errors were encountered: