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
This commit is contained in:
Drew Walters 2019-02-04 09:25:59 -06:00
parent 036e4b0c69
commit 237cb76f18
3 changed files with 13 additions and 3 deletions

View File

@ -16,11 +16,16 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- $envAll := . -}}
set -xe set -xe
rm /etc/apt/sources.list rm /etc/apt/sources.list
tee /etc/apt/sources.list << EOF tee /etc/apt/sources.list << EOF
deb [ allow-insecure=yes ] http://${MINI_MIRROR_ENDPOINT} squeeze main {{- $components := include "helm-toolkit.utils.joinListWithSpace" .Values.conf.test.components -}}
{{ range .Values.conf.test.dists }}
deb [ allow-insecure=yes ] {{ tuple "api" "public" "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} {{ . }} {{ $components -}}
{{ end }}
EOF EOF
apt-get update apt-get update

View File

@ -39,8 +39,6 @@ spec:
env: env:
- name: NO_PROXY - name: NO_PROXY
value: 127.0.0.1,.svc.cluster.local value: 127.0.0.1,.svc.cluster.local
- name: MINI_MIRROR_ENDPOINT
value: {{ tuple "api" "public" $envAll | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
volumeMounts: volumeMounts:
- name: mini-mirror-bin - name: mini-mirror-bin
mountPath: /tmp/helm-test.sh mountPath: /tmp/helm-test.sh

View File

@ -167,3 +167,10 @@ conf:
autoindex on; autoindex on;
} }
} }
test:
# NOTE(drewwalters96): Used by the mini-mirror Helm test; should be valid
# dists and components contained in the mini-mirror image.
dists:
- squeeze
components:
- main