Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 7504d5b

Browse files
mctavishcopybara-github
authored andcommitted
Add support for Cloud Run environment variables.
The Java debug agent will now: Use K_SERVICE to populate the service context (if available). Use K_REVISION to populate the version context (if available). PiperOrigin-RevId: 235204086 Change-Id: If683e31c82ac677c22311d9d2f8d4df461eea39b
1 parent 20fcd08 commit 7504d5b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/agent/internals/src/main/java/com/google/devtools/cdbg/debuglets/java/GcpEnvironment.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ static Map<String, String> getDebuggeeLabels() {
130130
if (module == null || module.isEmpty()) {
131131
module = environmentStore.get("GAE_MODULE_NAME");
132132
}
133+
if (module == null || module.isEmpty()) {
134+
module = environmentStore.get("K_SERVICE");
135+
}
133136
if ((module != null) && module.equals("default")) {
134137
module = null;
135138
}
@@ -146,6 +149,9 @@ static Map<String, String> getDebuggeeLabels() {
146149
if (majorVersion == null || majorVersion.isEmpty()) {
147150
majorVersion = environmentStore.get("GAE_MODULE_VERSION");
148151
}
152+
if (majorVersion == null || majorVersion.isEmpty()) {
153+
majorVersion = environmentStore.get("K_REVISION");
154+
}
149155
}
150156

151157
if ((majorVersion != null) && !majorVersion.isEmpty()) {

0 commit comments

Comments
 (0)