Revision cc6d0d73
Added by David Davis almost 7 years ago
app/controllers/containers/steps_controller.rb | ||
---|---|---|
35 | 35 |
end |
36 | 36 |
|
37 | 37 |
def build_state |
38 |
s = @state.send(:"build_#{step}", params[:"docker_container_wizard_states_#{step}"])
|
|
38 |
s = @state.send(:"build_#{step}", state_params)
|
|
39 | 39 |
instance_variable_set("@docker_container_wizard_states_#{step}", s) |
40 | 40 |
end |
41 | 41 |
|
42 |
def state_params |
|
43 |
attrs = case step |
|
44 |
when :preliminary |
|
45 |
[:wizard_state, :compute_resource_id] |
|
46 |
when :image |
|
47 |
[:repository_name, :tag, :wizard_state, :registry_id, :capsule_id, :katello] |
|
48 |
when :configuration |
|
49 |
[:name, :command, :entrypoint, :cpu_set, :cpu_shares, :memory, :wizard_state] |
|
50 |
when :environment |
|
51 |
[:tty, :docker_container_wizard_state_id, |
|
52 |
:attach_stdin, :attach_stdout, :attach_stderr, |
|
53 |
:exposed_ports_attributes => [], :environment_variables_attributes => [], |
|
54 |
:dns_attributes => [] |
|
55 |
] |
|
56 |
end |
|
57 |
|
|
58 |
params.require("docker_container_wizard_states_#{step}").permit(*attrs) |
|
59 |
end |
|
60 |
|
|
42 | 61 |
def set_form |
43 | 62 |
instance_variable_set( |
44 | 63 |
"@docker_container_wizard_states_#{step}", |
... | ... | |
46 | 65 |
end |
47 | 66 |
|
48 | 67 |
def create_container(start = true) |
49 |
@state.send(:"create_#{step}", params[:"docker_container_wizard_states_#{step}"])
|
|
68 |
@state.send(:"create_#{step}", state_params)
|
|
50 | 69 |
service = Service::Containers.new |
51 | 70 |
container = if start.is_a? TrueClass |
52 | 71 |
service.start_container!(@state) |
Also available in: Unified diff
Fixes #15888 - Remove attr_accessible calls