Class: Nvoi::Cli::Delete::Steps::TeardownTunnel

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

Overview

TeardownTunnel handles Cloudflare tunnel deletion

Instance Method Summary collapse

Constructor Details

#initialize(config, cf_client, log) ⇒ TeardownTunnel

Returns a new instance of TeardownTunnel.



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

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

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
# File 'lib/nvoi/cli/delete/steps/teardown_tunnel.rb', line 16

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

    delete_tunnel(service_name)
  end
end