Module: OsCtld::Container::Adaptor

Defined in:
lib/osctld/container/adaptor.rb

Overview

Adapt container config to make it compatible with the current system

Defined Under Namespace

Classes: Base, CGroup

Class Method Summary collapse

Class Method Details

.adapt(ct, config) ⇒ Hash

Returns adapted config.

Parameters:

  • ct (Container)
  • config (Hash)

    container config

Returns:

  • (Hash)

    adapted config



14
15
16
17
18
19
20
# File 'lib/osctld/container/adaptor.rb', line 14

def self.adapt(ct, config)
  (@adaptors || {}).each_value do |klass|
    config = klass.new(ct, config).adapt
  end

  config
end

.register(name, klass) ⇒ Object



6
7
8
9
# File 'lib/osctld/container/adaptor.rb', line 6

def self.register(name, klass)
  @adaptors ||= {}
  @adaptors[name] = klass
end