From 9bef22abe6fe452cfb2cc4853cdbeecd66dd914c Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Fri, 10 Feb 2023 08:24:02 -0500 Subject: [PATCH] Fix auth --- lib/vmpooler/dns/gcp/clouddns.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/vmpooler/dns/gcp/clouddns.rb b/lib/vmpooler/dns/gcp/clouddns.rb index 48232c1..e65643c 100644 --- a/lib/vmpooler/dns/gcp/clouddns.rb +++ b/lib/vmpooler/dns/gcp/clouddns.rb @@ -45,6 +45,10 @@ module Vmpooler end # main configuration options + def project + dns_config['project'] + end + def zone_name dns_config['zone_name'] end @@ -80,12 +84,11 @@ module Vmpooler retry_factor = global_config[:config]['retry_factor'] || 10 try = 1 begin - scopes = ['https://www.googleapis.com/auth/cloud-platform'] - - Google::Auth.get_application_default(scopes) + Google::Cloud::Dns.configure do |config| + config.project_id = project + end dns = Google::Cloud::Dns.new - # dns.authorization = authorization metrics.increment('connect.open') dns