Skip to content

fix: use core id provider as backup provider #1798

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

Merged
merged 5 commits into from
May 6, 2023

Conversation

JoeWang1127
Copy link
Contributor

Fix #1793.

@JoeWang1127 JoeWang1127 marked this pull request as ready for review May 5, 2023 02:28
@JoeWang1127 JoeWang1127 requested a review from meltsufin May 5, 2023 02:28
@Test
void testSecretManagerWithoutProjectId() {
contextRunner.run(
ctx -> assertThat(ctx.getBean(GcpSecretManagerProperties.class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not testing GcpSecretManagerAutoConfiguration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's not easy to test the project id as GcpSecretManagerAutoConfiguration doesn't expose a getter method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a getter method in SecretManagerTemplate so that project id can be tested.

@Test
void testSecretManagerWithProjectId() {
contextRunner
.withPropertyValues("spring.cloud.gcp.secretmanager.project-id=testProject")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a test with spring.cloud.gcp.project-id=testGlobalProject.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@JoeWang1127 JoeWang1127 requested a review from meltsufin May 5, 2023 18:38
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@JoeWang1127 JoeWang1127 enabled auto-merge (squash) May 5, 2023 19:29
@JoeWang1127 JoeWang1127 disabled auto-merge May 5, 2023 19:29
@JoeWang1127 JoeWang1127 merged commit 1b04165 into main May 6, 2023
@JoeWang1127 JoeWang1127 deleted the fix/backoff-id-provider-secret-manager branch May 6, 2023 00:36
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.

spring.cloud.gcp.project-id is not honored when using spring-cloud-gcp-starter-secretmanager
2 participants