Class: Nvoi::Cli::Delete::Steps::TeardownDns

Inherits:
Object
  • Object
show all
Defined in:
lib/nvoi/cli/delete/steps/teardown_dns.rb

Overview

TeardownDns handles DNS record deletion

Instance Method Summary collapse

Constructor Details

#initialize(config, cf_client, log) ⇒ TeardownDns

Returns a new instance of TeardownDns.



9
10
11
12
13
# File 'lib/nvoi/cli/delete/steps/teardown_dns.rb', line 9

def initialize(config, cf_client, log)
  @config = config
  @cf_client = cf_client
  @log = log
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
# File 'lib/nvoi/cli/delete/steps/teardown_dns.rb', line 15

def run
  @config.deploy.application.app.each do |_service_name, service|
    next unless service&.domain && !service.domain.empty?

    delete_dns_records(service.domain, service.subdomain)
  end
end