diff --git a/devstack/lib/common b/devstack/lib/common index 2b85147e..c972f69b 100644 --- a/devstack/lib/common +++ b/devstack/lib/common @@ -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 +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 \ No newline at end of file diff --git a/devstack/lib/rpc_backend b/devstack/lib/rpc_backend new file mode 100755 index 00000000..49a239be --- /dev/null +++ b/devstack/lib/rpc_backend @@ -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 \ No newline at end of file diff --git a/devstack/settings b/devstack/settings index 08934a42..fb321367 100644 --- a/devstack/settings +++ b/devstack/settings @@ -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