From 6b00b66f9a879b545ffb6f2416cc2add88be3be1 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 5 Nov 2024 11:52:59 -0800 Subject: [PATCH] fix: update universe domain URI (#572) --- src/Credentials/GCECredentials.php | 2 +- tests/Credentials/GCECredentialsTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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(''));