From d66db145dd84cb11b566bb77f21c0997cf63d89d Mon Sep 17 00:00:00 2001 From: minherz Date: Wed, 2 Mar 2022 09:06:09 +0000 Subject: [PATCH] fix: do not use GAE_RUNTIME for GAE environment detection Stops using GAE_RUNTIME envvar to detect AppEngine environment. --- .../java/com/google/cloud/logging/MonitoredResourceUtil.java | 1 - .../java/com/google/cloud/logging/MonitoredResourceUtilTest.java | 1 - 2 files changed, 2 deletions(-) diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java index df450aee4..bba9bf8e5 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java @@ -175,7 +175,6 @@ private static Resource detectResourceType() { return Resource.CloudRun; } if (getter.getEnv("GAE_INSTANCE") != null - && getter.getEnv("GAE_RUNTIME") != null && getter.getEnv("GAE_SERVICE") != null && getter.getEnv("GAE_VERSION") != null) { return Resource.AppEngine; diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/MonitoredResourceUtilTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/MonitoredResourceUtilTest.java index ebcf398d9..136c8e8e6 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/MonitoredResourceUtilTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/MonitoredResourceUtilTest.java @@ -155,7 +155,6 @@ public void testResourceTypeK8sContainer() { private void setupCommonGAEMocks(String mockedModuleId, String mockedVersionId) { expect(getterMock.getAttribute("instance/zone")).andReturn(MOCKED_QUALIFIED_ZONE).once(); expect(getterMock.getEnv("GAE_INSTANCE")).andReturn(MOCKED_NON_EMPTY).once(); - expect(getterMock.getEnv("GAE_RUNTIME")).andReturn(MOCKED_NON_EMPTY).once(); expect(getterMock.getEnv("GAE_SERVICE")).andReturn(mockedModuleId).times(2); expect(getterMock.getEnv("GAE_VERSION")).andReturn(mockedVersionId).times(2); expect(getterMock.getEnv(anyString())).andReturn(null).anyTimes();