diff --git a/cinder/templates/bin/_cinder-volume.sh.tpl b/cinder/templates/bin/_cinder-volume.sh.tpl index 64aa3828aa..a248f35284 100644 --- a/cinder/templates/bin/_cinder-volume.sh.tpl +++ b/cinder/templates/bin/_cinder-volume.sh.tpl @@ -19,4 +19,5 @@ limitations under the License. set -ex exec cinder-volume \ --config-file /etc/cinder/cinder.conf \ - --config-file /etc/cinder/conf/backends.conf + --config-file /etc/cinder/conf/backends.conf \ + --config-file /tmp/pod-shared/internal_tenant.conf diff --git a/cinder/templates/bin/_create-internal-tenant-id.sh.tpl b/cinder/templates/bin/_create-internal-tenant-id.sh.tpl new file mode 100755 index 0000000000..105825644c --- /dev/null +++ b/cinder/templates/bin/_create-internal-tenant-id.sh.tpl @@ -0,0 +1,31 @@ +#!/bin/bash + +{{/* +Copyright 2019 The Openstack-Helm Authors. + +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. +*/}} + +set -ex + + +USER_PROJECT_ID=$(openstack project create --or-show --enable -f value -c id \ + --domain="${PROJECT_DOMAIN_ID}" \ + "${INTERNAL_PROJECT_NAME}"); + +USER_ID=$(openstack user create --or-show --enable -f value -c id \ + --domain="${USER_DOMAIN_ID}" \ + --project-domain="${PROJECT_DOMAIN_ID}" \ + --project="${USER_PROJECT_ID}" \ + "${INTERNAL_USER_NAME}"); + diff --git a/cinder/templates/bin/_retrieve-internal-tenant-id.sh.tpl b/cinder/templates/bin/_retrieve-internal-tenant-id.sh.tpl new file mode 100755 index 0000000000..b85f69fdc4 --- /dev/null +++ b/cinder/templates/bin/_retrieve-internal-tenant-id.sh.tpl @@ -0,0 +1,32 @@ +#!/bin/bash + +{{/* +Copyright 2019 The Openstack-Helm Authors. + +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. +*/}} + +set -ex + + +USER_PROJECT_ID=$(openstack project show -f value -c id \ + "${INTERNAL_PROJECT_NAME}"); + +USER_ID=$(openstack user show -f value -c id \ + "${INTERNAL_USER_NAME}"); + +tee /tmp/pod-shared/internal_tenant.conf <