Merge "Add rpc_backend override in devstack"

This commit is contained in:
Zuul 2020-07-17 22:02:59 +00:00 committed by Gerrit Code Review
commit 50080c4d96
3 changed files with 45 additions and 0 deletions

View File

@ -90,3 +90,14 @@ spec:
EOF
}
export -f _get_or_create_endpoint_with_interface
# Get plain data from the specified secret
# Usage: get_data_from_secret <secret> <namespace> <key>
function get_data_from_secret {
local secret=$1
local ns=$2
local key=$3
local data=$(kubectl get secret -n $ns $secret -o jsonpath="{.data.$key}" | base64 --decode)
echo $data
}
export -f get_data_from_secret

33
devstack/lib/rpc_backend Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
#
# Copyright 2020 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# iniset rpc configuration
function iniset_k8s_rpc_backend {
local package=$1
local file=$2
local section=${3:-DEFAULT}
local conn_url=$4
iniset $file $section transport_url $conn_url
if [ -n "$RABBIT_HEARTBEAT_TIMEOUT_THRESHOLD" ]; then
iniset $file oslo_messaging_rabbit heartbeat_timeout_threshold $RABBIT_HEARTBEAT_TIMEOUT_THRESHOLD
fi
if [ -n "$RABBIT_HEARTBEAT_RATE" ]; then
iniset $file oslo_messaging_rabbit heartbeat_rate $RABBIT_HEARTBEAT_RATE
fi
}
export -f iniset_k8s_rpc_backend

View File

@ -20,3 +20,4 @@ source $DEST/openstack-operator/devstack/lib/common
source $DEST/openstack-operator/devstack/lib/glance
source $DEST/openstack-operator/devstack/lib/horizon
source $DEST/openstack-operator/devstack/lib/keystone
source $DEST/openstack-operator/devstack/lib/rpc_backend