-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Service binding doesn't work as SERVICE_BINDING_ROOT expression is not expanded #37461
Comments
cc @radcortez |
I just opened this issue to make it clear how long service binding didn't work, as it is IMHO showcase of how much is service binding used by users in non-LTS releases considering this wasn't reported between 3.3 and 3.6. I wonder if anyone but Quarkus QE use it. @radcortez can just look at #37462. |
The I've tried to replicate the issue here: smallrye/smallrye-config@56f6e27, but it seems to work, so maybe I'm missing something. Can you confirm on your debug that you can see the Expression interceptor in the context (without adding it manually)? |
ok
I can't debug JVM app inside OpenShift, added some reflection
and printed out following:
Do you need more? I'd expect no service binding to work, so if you can run some hello world you should be able to debug it yourself. If I can provide more info that you need, write me here or elsewhere, I'll try. |
Thanks. If you notice on your debug:
The interceptor is there, but apparently, the expression is not being evaluated. From the other log, it seems that the value set is Lines 23 to 24 in 6f6fb9e
Line 51 in bec7a73
Lines 81 to 86 in bec7a73
It seems that something is setting the |
One option that I see is if the value is being set with some sort of escaping to not perform the expression evaluation. Can you confirm the exact value being set? |
I'll provide you with information you asked in above comments. And I absolutely understand why you don't want to fix it the way I suggested, but I'm not sure from your questions whether you understand the situation - my PR fixed the problem for me, hence if |
|
@radcortez I sent you full log by email as I don't want to spend long time removing sensitive information, but here is the gist:
for code
|
|
|
Maybe we would need to apply your fix, but my point was that there is already an |
I agree. Maybe I wrote it incorrectly @radcortez , I tried to stress it fixes the issue as it is valuable information. |
Ok, the issue here is that the mapping defaults are not being propagated to the context and are on a separate chain, meaning that the values are still populated, but the chain containing the expression resolution is not applied. |
This will fix it: smallrye/smallrye-config#1060 For now, please set |
Alright, thank you. |
Enables PG SB test as quarkusio/quarkus#37461 is fixed, run it against 4.14 from my workstation and works. Ports quarkus-qe#1547 as the test fails without it.
Describe the bug
Service binding doesn't work as mounted secret is never found as file because config expression is not expanded.
Problem was brought in when trying to fix other problem by this PR: #34792
Expected behavior
Service binding works.
Actual behavior
Service binding in OCP 4.14 and 4.11 binds secret in following fashion:
and application never starts with:
I put some logging to
io.quarkus.kubernetes.service.binding.runtime.KubernetesServiceBindingConfigSourceFactory#getConfigSources(io.smallrye.config.ConfigSourceContext)
and got:How to Reproduce?
Steps to reproduce:
git clone [email protected]:michalvavrik/quarkus-test-suite.git
cd quarkus-test-suite/service-binding/postgresql-crunchy-classic
git checkout feature/fix-and-enable-crunchy-sb-tests
mvn clean verify -Dopenshift
Output of
uname -a
orver
Fedora 38
Output of
java -version
OpenJDK Runtime Environment Temurin-17.0.7+9
Quarkus version or git rev
999-SNAPSHOT,
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.3
Additional information
I have a fix.
The text was updated successfully, but these errors were encountered: