Project

General

Profile

Revision ef7e4271

Added by Partha Aji about 7 years ago

Fixes #11354 - Made the container deal with cpu shares and cpu sets correctly

According to docker remote api 'cpu shares' need to be integers.
However foreman docker sends it a float instead causing a
'cant convert to int64' error. This commit fixes that by ensuring what
gets sent to the container is an integer

Similarly According to docker remote api cpusets need to be strings.
However foreman docker sends it an integer instead causing a
'cant convert to string' error. This commit fixes that by ensuring what
gets sent to the container is an string

View differences:

db/migrate/20150814205620_change_container_column_type.rb
1
class ChangeContainerColumnType < ActiveRecord::Migration
2
  def up
3
    change_column :containers, :cpu_shares, :integer
4
    change_column :docker_container_wizard_states_configurations, :cpu_shares, :integer
5
    change_column :docker_container_wizard_states_configurations, :cpu_set, :string
6
  end
7

  
8
  def down
9
    change_column :containers, :cpu_shares, :float
10
    change_column :docker_container_wizard_states_configurations, :cpu_shares, :float
11
    change_column :docker_container_wizard_states_configurations, :cpu_set, :integer
12
  end
13
end

Also available in: Unified diff