Add support for [docker_registry] parameters
Change-Id: I95e3a312cd429d7c95c2c734408f03774e552186
This commit is contained in:
parent
b3f2138647
commit
c8b6273600
25
manifests/docker_registry.pp
Normal file
25
manifests/docker_registry.pp
Normal file
@ -0,0 +1,25 @@
|
||||
# == Class: magnum::docker_registry
|
||||
#
|
||||
# Setup magnum docker_registry.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*swift_region*]
|
||||
# (optional) Region name of Swift.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*swift_registry_container*]
|
||||
# (optional) Name of the container in Swift which docker registry stores
|
||||
# images in.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
class magnum::docker_registry (
|
||||
$swift_region = $::os_service_default,
|
||||
$swift_registry_container = $::os_service_default,
|
||||
) {
|
||||
|
||||
magnum_config {
|
||||
'docker_registry/swift_region': value => $swift_region;
|
||||
'docker_registry/swift_registry_container': value => $swift_registry_container;
|
||||
}
|
||||
}
|
4
releasenotes/notes/docker_registry-3033836003445561.yaml
Normal file
4
releasenotes/notes/docker_registry-3033836003445561.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``magnum::docker_registry`` class has been added.
|
38
spec/classes/magnum_docker_registry_spec.rb
Normal file
38
spec/classes/magnum_docker_registry_spec.rb
Normal file
@ -0,0 +1,38 @@
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'magnum::docker_registry' do
|
||||
shared_examples 'magnum::docker_registry' do
|
||||
|
||||
it 'contains default values' do
|
||||
is_expected.to contain_magnum_config('docker_registry/swift_region').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_magnum_config('docker_registry/swift_registry_container').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
|
||||
context 'configure docker_registry with parameters' do
|
||||
let :params do
|
||||
{
|
||||
:swift_region => 'regionOne',
|
||||
:swift_registry_container => 'docker_registry',
|
||||
}
|
||||
end
|
||||
|
||||
it 'contains overrided values' do
|
||||
is_expected.to contain_magnum_config('docker_registry/swift_region').with_value('regionOne')
|
||||
is_expected.to contain_magnum_config('docker_registry/swift_registry_container').with_value('docker_registry')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge(OSDefaults.get_facts({}))
|
||||
end
|
||||
|
||||
it_behaves_like 'magnum::docker_registry'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user