class KuberKit::ServiceReader::Reader

Constants

AttributeNotSetError

Public Instance Methods

read(shell, service) click to toggle source
# File lib/kuber_kit/service_reader/reader.rb, line 12
def read(shell, service)
  if service.template_name.nil?
    raise AttributeNotSetError, "Please set template for service using #template method"
  end

  template = template_store.get(service.template_name)

  context_helper = context_helper_factory.build_service_context(shell, service)

  template = reader.read(shell, template)

  result = text_preprocessor.compile(template, context_helper: context_helper)

  result
end