
This PS udpates the default image in the chart to the latest OSH image. Change-Id: Ib8d2a72ad48049fe02560dc4405f0088890b6f64 Signed-off-by: Pete Birley <pete@port.direct>
54 lines
1.9 KiB
Smarty
54 lines
1.9 KiB
Smarty
{{/*
|
|
Copyright 2017 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.
|
|
*/}}
|
|
|
|
{{- define "helm-toolkit.scripts.create_s3_bucket" }}
|
|
#!/bin/bash
|
|
|
|
function create_rgw_s3_bucket ()
|
|
{
|
|
if [ "$RGW_PROTO" = "http" ]; then
|
|
create_bucket=$(s3cmd mb s3://$S3_BUCKET --host=$RGW_HOST --host-bucket=$RGW_HOST --access_key=$S3_ADMIN_ACCESS_KEY --secret_key=$S3_ADMIN_SECRET_KEY --no-ssl)
|
|
else
|
|
create_bucket=$(s3cmd mb s3://$S3_BUCKET --host=$RGW_HOST --host-bucket=$RGW_HOST --access_key=$S3_ADMIN_ACCESS_KEY --secret_key=$S3_ADMIN_SECRET_KEY)
|
|
fi
|
|
if [ $? -eq 0 ]; then
|
|
echo "Bucket $S3_BUCKET created"
|
|
else
|
|
echo "Error trying to create bucket $S3_BUCKET"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
function modify_bucket_acl ()
|
|
{
|
|
if [ "$RGW_PROTO" = "http" ]; then
|
|
modify_acl=$(s3cmd setacl s3://$S3_BUCKET --host=$RGW_HOST --host-bucket=$RGW_HOST --access_key=$S3_ADMIN_ACCESS_KEY --secret_key=$S3_ADMIN_SECRET_KEY --no-ssl --acl-grant=read:$S3_USERNAME --acl-grant=write:$S3_USERNAME)
|
|
else
|
|
modify_acl=$(s3cmd setacl s3://$S3_BUCKET --host=$RGW_HOST --host-bucket=$RGW_HOST --access_key=$S3_ADMIN_ACCESS_KEY --secret_key=$S3_ADMIN_SECRET_KEY --acl-grant=read:$S3_USERNAME --acl-grant=write:$S3_USERNAME)
|
|
fi
|
|
if [ $? -eq 0 ]; then
|
|
echo "Bucket $S3_BUCKET ACL updated"
|
|
else
|
|
echo "Error trying to update bucket $S3_BUCKET ACL"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
create_rgw_s3_bucket
|
|
modify_bucket_acl
|
|
|
|
{{- end }}
|