Sha256: b1d4f2b477ba7ede9df1d459ae2dc9226bfd90801a97f752679af60cb47f9d6a
Contents?: true
Size: 596 Bytes
Versions: 13
Compression:
Stored size: 596 Bytes
Contents
module Kontena::Cli::Stacks module YAML class Opto::Resolvers::ServiceInstances < ::Opto::Resolver def resolve return nil unless current_master && current_grid read_command = Kontena::Cli::Stacks::ShowCommand.new([self.stack]) stack = read_command.fetch_stack(self.stack) service = stack['services'].find { |s| s['name'] == hint } if service service['instances'] else nil end rescue Kontena::Errors::StandardError nil end def stack ENV['STACK'] end end end end
Version data entries
13 entries across 13 versions & 1 rubygems