Add rpc_backend override in devstack

Change-Id: Ibc641fc1a52f77b50a1ce193c081cf401b002973
This commit is contained in:
okozachenko 2020-06-22 19:42:09 +03:00
parent 02520101bc
commit 277c639f08
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

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