Class: Captive::Commands::DbPsql

Inherits:
Object
  • Object
show all
Defined in:
lib/captive/commands/db_psql.rb

Instance Method Summary collapse

Constructor Details

#initialize(kubectl:, target: DbTarget.new(kubectl: kubectl)) ⇒ DbPsql

Returns a new instance of DbPsql.



9
10
11
12
# File 'lib/captive/commands/db_psql.rb', line 9

def initialize(kubectl:, target: DbTarget.new(kubectl: kubectl))
  @kubectl = kubectl
  @target  = target
end

Instance Method Details

#run(app) ⇒ Object



14
15
16
17
# File 'lib/captive/commands/db_psql.rb', line 14

def run(app)
  pod, user, password = @target.resolve(app)
  @kubectl.psql_interactive(app, pod, user: user, password: password)
end