modules/mu/clouds/google/function.rb in cloud-mu-3.1.5 vs modules/mu/clouds/google/function.rb in cloud-mu-3.1.6

- old
+ new

@@ -232,13 +232,13 @@ # @param noop [Boolean]: If true, will only print what would be done # @param ignoremaster [Boolean]: If true, will remove resources not flagged as originating from this Mu server # @param region [String]: The cloud provider region # @return [void] def self.cleanup(noop: false, ignoremaster: false, region: MU.curRegion, credentials: nil, flags: {}) - flags["project"] ||= MU::Cloud::Google.defaultProject(credentials) - return if !MU::Cloud::Google::Habitat.isLive?(flags["project"], credentials) + flags["habitat"] ||= MU::Cloud::Google.defaultProject(credentials) + return if !MU::Cloud::Google::Habitat.isLive?(flags["habitat"], credentials) # Make sure we catch regional *and* zone functions - found = MU::Cloud::Google::Function.find(credentials: credentials, region: region, project: flags["project"]) + found = MU::Cloud::Google::Function.find(credentials: credentials, region: region, project: flags["habitat"]) found.each_pair { |cloud_id, desc| if (desc.description and desc.description == MU.deploy_id) or (desc.labels and desc.labels["mu-id"] == MU.deploy_id.downcase and (ignoremaster or desc.labels["mu-master-ip"] == MU.mu_public_ip.gsub(/\./, "_"))) or (flags["known"] and flags["known"].include?(cloud_id)) MU.log "Deleting Cloud Function #{desc.name}"