summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Walters <drewwalters96@gmail.com>2019-02-04 09:25:59 -0600
committerDrew Walters <drewwalters96@gmail.com>2019-03-04 11:16:52 -0600
commit237cb76f1851fa45002ad8d8cc55a0764155cb4c (patch)
treeb140d5e9a31c868f6a4b0c8beb50449b95adf739
parent036e4b0c69074731e50b414e8e568d1559b13901 (diff)
mini-mirror: Use templated values for Helm test
Currently, the mini-mirror Helm test uses pre-defined components and distributions, making it ineffective for custom built-images. This commit uses templating to retrieve the appropriate service address, distributions, and components when rendering the Helm test. Change-Id: Idd7771756da1da96c1ad9ae14b2fdc6b6bb9debb
Notes
Notes (review): Code-Review+1: Dustin Specker <dustin.specker@att.com> Code-Review+2: Pete Birley <petebirley@gmail.com> Code-Review+2: Chris Wedgwood <cw@f00f.org> Workflow+1: Chris Wedgwood <cw@f00f.org> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 15 Mar 2019 05:48:02 +0000 Reviewed-on: https://review.openstack.org/634762 Project: openstack/openstack-helm-addons Branch: refs/heads/master
-rw-r--r--mini-mirror/templates/bin/_helm_test.sh.tpl7
-rw-r--r--mini-mirror/templates/pod-helm-test.yaml2
-rw-r--r--mini-mirror/values.yaml7
3 files changed, 13 insertions, 3 deletions
diff --git a/mini-mirror/templates/bin/_helm_test.sh.tpl b/mini-mirror/templates/bin/_helm_test.sh.tpl
index b4b89b5..4c20bc5 100644
--- a/mini-mirror/templates/bin/_helm_test.sh.tpl
+++ b/mini-mirror/templates/bin/_helm_test.sh.tpl
@@ -16,11 +16,16 @@ See the License for the specific language governing permissions and
16limitations under the License. 16limitations under the License.
17*/}} 17*/}}
18 18
19{{- $envAll := . -}}
20
19set -xe 21set -xe
20 22
21rm /etc/apt/sources.list 23rm /etc/apt/sources.list
22tee /etc/apt/sources.list << EOF 24tee /etc/apt/sources.list << EOF
23deb [ allow-insecure=yes ] http://${MINI_MIRROR_ENDPOINT} squeeze main 25{{- $components := include "helm-toolkit.utils.joinListWithSpace" .Values.conf.test.components -}}
26{{ range .Values.conf.test.dists }}
27deb [ allow-insecure=yes ] {{ tuple "api" "public" "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} {{ . }} {{ $components -}}
28{{ end }}
24EOF 29EOF
25 30
26apt-get update 31apt-get update
diff --git a/mini-mirror/templates/pod-helm-test.yaml b/mini-mirror/templates/pod-helm-test.yaml
index 9be2679..af1676a 100644
--- a/mini-mirror/templates/pod-helm-test.yaml
+++ b/mini-mirror/templates/pod-helm-test.yaml
@@ -39,8 +39,6 @@ spec:
39 env: 39 env:
40 - name: NO_PROXY 40 - name: NO_PROXY
41 value: 127.0.0.1,.svc.cluster.local 41 value: 127.0.0.1,.svc.cluster.local
42 - name: MINI_MIRROR_ENDPOINT
43 value: {{ tuple "api" "public" $envAll | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
44 volumeMounts: 42 volumeMounts:
45 - name: mini-mirror-bin 43 - name: mini-mirror-bin
46 mountPath: /tmp/helm-test.sh 44 mountPath: /tmp/helm-test.sh
diff --git a/mini-mirror/values.yaml b/mini-mirror/values.yaml
index ef1265a..cea3a73 100644
--- a/mini-mirror/values.yaml
+++ b/mini-mirror/values.yaml
@@ -167,3 +167,10 @@ conf:
167 autoindex on; 167 autoindex on;
168 } 168 }
169 } 169 }
170 test:
171 # NOTE(drewwalters96): Used by the mini-mirror Helm test; should be valid
172 # dists and components contained in the mini-mirror image.
173 dists:
174 - squeeze
175 components:
176 - main