Skip to content

Commit

Permalink
fix: Use updated metadata path for universe-domain (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma authored Oct 23, 2024
1 parent aaa7bb7 commit 237409f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/googleauth/compute_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def add_universe_domain_to hash
# TODO: Remove when universe domain metadata endpoint is stable (see b/349488459).
"googleapis.com"
else
Google::Cloud.env.lookup_metadata "universe", "universe_domain"
Google::Cloud.env.lookup_metadata "universe", "universe-domain"
end
universe_domain = "googleapis.com" if !universe_domain || universe_domain.empty?
hash["universe_domain"] = universe_domain.strip
Expand Down
2 changes: 1 addition & 1 deletion spec/googleauth/compute_engine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
end

def make_auth_stubs opts
universe_stub = stub_request(:get, "http://169.254.169.254/computeMetadata/v1/universe/universe_domain")
universe_stub = stub_request(:get, "http://169.254.169.254/computeMetadata/v1/universe/universe-domain")
.with(headers: { "Metadata-Flavor" => "Google" })
if !defined?(@universe_domain) || !@universe_domain
universe_stub.to_return body: "", status: 404, headers: {"Metadata-Flavor" => "Google" }
Expand Down

0 comments on commit 237409f

Please sign in to comment.