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

fix: add credential runtime hint for graalvm compilation #3200

Merged
merged 5 commits into from
Sep 13, 2024

Conversation

zhumin8
Copy link
Contributor

@zhumin8 zhumin8 commented Sep 10, 2024

fixes #2569

As reported in #2569, Graalvm is not detecting Credentials class used in GcpProperties, even though Credentials has been marked by @NestedConfigurationProperty.
What is affected?

  • spring-cloud-gcp-core external configurations for spring.cloud.gcp.credentials.encoded-key and spring.cloud.gcp.credentials.location
  • module specific configs for credentials. e.g. spring.cloud.gcp.firestore.credentials.encoded-key

What is not affected?
Setting GOOGLE_APPLICATION_CREDENTIALS goes through ADC and does not involve spring.cloud.gcp.credentials.encoded-key property, thus is not affected.

Changes in this pr:

  • Added runtime hint for Credentials on GcpProperties to resolve this. This change also fixes for non-core module's autoconfiguration because each of them depends on GcpContextAutoConfiguration from core. e.g. GcpFirestoreAutoConfiguration
  • Added test to starter firestore sample:
    • test: FirestoreSampleAppNativeIntegrationTests.java, this test only runs when "it.firestore.native=true", and does not run the CommandRunner in sample app.
    • test setup:
      • pass encoded ci sa key to native test config for firestore samples.
      • enable this new test for native test config

Copy link

sonarcloud bot commented Sep 11, 2024

@zhumin8 zhumin8 marked this pull request as ready for review September 11, 2024 20:48
@zhumin8 zhumin8 requested a review from a team as a code owner September 11, 2024 20:48
@zhumin8 zhumin8 merged commit f7fc095 into main Sep 13, 2024
75 of 76 checks passed
@zhumin8 zhumin8 deleted the fix-graal-credential branch September 13, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Property spring.cloud.gcp.credentials.encoded-key not works in a Graalvm compiled app
2 participants