Class: Kontena::Cli::Stacks::YAML::RegistryLoader

Inherits:
StackFileLoader show all
Defined in:
lib/kontena/cli/stacks/yaml/stack_file_loader/registry_loader.rb

Instance Attribute Summary

Attributes inherited from StackFileLoader

#parent, #source

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from StackFileLoader

#content, #dependencies, #flat_dependencies, for, inherited, #initialize, #inspect, loaders, #reader, #stack_name, #to_h, #yaml

Constructor Details

This class inherits a constructor from Kontena::Cli::Stacks::YAML::StackFileLoader

Class Method Details

.match?(source, parent = nil) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/kontena/cli/stacks/yaml/stack_file_loader/registry_loader.rb', line 4

def self.match?(source, parent = nil)
  source =~ /\A[a-zA-Z0-9\_\.\-]+\/[a-zA-Z0-9\_\.\-]+(?::.*)?\z/ && !FileLoader.match?(source, parent)
end

Instance Method Details

#originObject



12
13
14
# File 'lib/kontena/cli/stacks/yaml/stack_file_loader/registry_loader.rb', line 12

def origin
  "registry"
end

#read_contentObject



8
9
10
# File 'lib/kontena/cli/stacks/yaml/stack_file_loader/registry_loader.rb', line 8

def read_content
  Kontena::StacksCache.pull(Kontena::Cli::Stacks::StackName.new(source))
end

#registryObject



16
17
18
19
20
# File 'lib/kontena/cli/stacks/yaml/stack_file_loader/registry_loader.rb', line 16

def registry
   = Kontena::Cli::Config.
  raise "Current account not set" if .nil?
  .stacks_url
end