Merge "Fail if pipeline does not include the proper server"

This commit is contained in:
Zuul
2022-08-23 07:56:48 +00:00
committed by Gerrit Code Review
4 changed files with 10 additions and 9 deletions

View File

@@ -62,8 +62,8 @@ class swift::internal_client (
validate_legacy(Array, 'validate_array', $pipeline)
if(! member($pipeline, 'proxy-server')) {
warning('pipeline parameter must contain proxy-server')
if empty($pipeline) or $pipeline[-1] != 'proxy-server' {
fail('proxy-server must be the last element in pipeline')
}
swift_internal_client_config {

View File

@@ -212,8 +212,8 @@ class swift::proxy(
warning('no auth type provided in the pipeline')
}
if(! member($pipeline, 'proxy-server')) {
warning('pipeline parameter must contain proxy-server')
if empty($pipeline) or $pipeline[-1] != 'proxy-server' {
fail('proxy-server must be the last element in pipeline')
}
if($auth_type == 'tempauth' and ! $account_autocreate ){

View File

@@ -257,10 +257,11 @@ define swift::storage::server(
# Warn if ${type-server} isn't included in the pipeline
$pipeline_array = any2array($pipeline)
if !member($pipeline_array, "${type}-server") {
warning("swift storage server ${type} must specify ${type}-server")
if empty($pipeline_array) or $pipeline_array[-1] != "${type}-server" {
fail("${type}-server must be the last element in pipeline")
}
if ($log_udp_port and !$log_udp_host) {
fail ('log_udp_port requires log_udp_host to be set')
}

View File

@@ -36,9 +36,9 @@ describe 'swift::storage::all' do
:object_port => "7000",
:container_port => "7001",
:account_port => "7002",
:object_pipeline => ["healthcheck"],
:container_pipeline => ["healthcheck"],
:account_pipeline => ["healthcheck"],
:object_pipeline => ['healthcheck', 'object-server'],
:container_pipeline => ['healthcheck', 'container-server'],
:account_pipeline => ['healthcheck', 'account-server'],
:splice => true,
:log_facility => ['LOG_LOCAL2', 'LOG_LOCAL3'],
:incoming_chmod => '0644',