openstack-helm/glance/templates/bin/_clean-image.sh.tpl
Robert Choi 99916b4d04 Fix wrong value key in glance clean-image script
This PS reflects updated value key to the glance clean-image
script to fix a bug that the bootstrapped images are not deleted
when the chart is deleted.

Change-Id: I6bd126049c539a74e23a1ca5d2957b89fdea78fc
2018-05-12 14:36:37 +00:00

30 lines
834 B
Smarty

#!/bin/bash
{{/*
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.
*/}}
set -ex
{{ if .Values.bootstrap.enabled }}
{{ range .Values.bootstrap.structured.images }}
{{ if .id -}}
openstack image show {{ .id | quote }} && \
openstack image delete {{ .id | quote }}
{{ end -}}
{{ end }}
{{ end }}
exit 0