Module: Katello::Concerns::Containers::StepsControllerExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/katello/concerns/containers/steps_controller_extensions.rb

Instance Method Summary collapse

Instance Method Details

#build_state_with_katelloObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/controllers/katello/concerns/containers/steps_controller_extensions.rb', line 19

def build_state_with_katello
  if step == :image && params.key?(:katello)
    repo = nil
    tag = nil
    capsule_id = nil
    if params[:repository] && params[:repository][:id]
      repo = Repository.where(:id => params[:repository][:id]).first
    end

    if params[:tag] && params[:tag][:id]
      tag = DockerTag.where(:id => params[:tag][:id]).first
    end
    if params[:capsule] && params[:capsule][:id]
      capsule_id = params[:capsule][:id]
    end
    @docker_container_wizard_states_image = @state.build_image(:repository_name => repo.try(:pulp_id),
                        :tag => tag.try(:name),
                        :capsule_id => capsule_id,
                        :katello => true)
  else
    build_state_without_katello
  end
end

#set_form_with_katelloObject



11
12
13
14
15
16
17
# File 'app/controllers/katello/concerns/containers/steps_controller_extensions.rb', line 11

def set_form_with_katello
  if step == :image && @state.image.nil?
    @docker_container_wizard_states_image = @state.build_image(:katello => true)
  else
    set_form_without_katello
  end
end