Skip to content

Commit

Permalink
fix: update universe domain URI (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Nov 5, 2024
1 parent 2d7d03d commit 6b00b66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Credentials/GCECredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tests/Credentials/GCECredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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(''));
Expand Down

0 comments on commit 6b00b66

Please sign in to comment.