diff --git a/src/Credentials/GCECredentials.php b/src/Credentials/GCECredentials.php index 235b34a60..430e6e6a7 100644 --- a/src/Credentials/GCECredentials.php +++ b/src/Credentials/GCECredentials.php @@ -100,7 +100,7 @@ class GCECredentials extends CredentialsLoader implements /** * The metadata path of the project ID. */ - const UNIVERSE_DOMAIN_URI_PATH = 'v1/universe/universe_domain'; + const UNIVERSE_DOMAIN_URI_PATH = 'v1/universe/universe-domain'; /** * The header whose presence indicates GCE presence. diff --git a/tests/Credentials/GCECredentialsTest.php b/tests/Credentials/GCECredentialsTest.php index f6d9c2266..a7861d468 100644 --- a/tests/Credentials/GCECredentialsTest.php +++ b/tests/Credentials/GCECredentialsTest.php @@ -660,7 +660,7 @@ public function testGetUniverseDomain() $httpHandler = function ($request) use (&$timesCalled, $expected) { $timesCalled++; $this->assertEquals( - '/computeMetadata/v1/universe/universe_domain', + '/computeMetadata/v1/universe/universe-domain', $request->getUri()->getPath() ); $this->assertEquals(1, $timesCalled, 'should only be called once'); @@ -682,7 +682,7 @@ public function testGetUniverseDomainEmptyStringReturnsDefault() // Pretend we are on GCE and mock the MDS returning an empty string for the universe domain. $httpHandler = function ($request) { $this->assertEquals( - '/computeMetadata/v1/universe/universe_domain', + '/computeMetadata/v1/universe/universe-domain', $request->getUri()->getPath() ); return new Psr7\Response(200, [], Utils::streamFor(''));