Pushing mongod and mongoexpress integration
This commit is contained in:
		
							
								
								
									
										22
									
								
								opencloud/charts/mongo-express/templates/tests/_helpers.tpl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								opencloud/charts/mongo-express/templates/tests/_helpers.tpl
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
{{/* vim: set filetype=mustache: */}}
 | 
			
		||||
{{/*
 | 
			
		||||
Create a default fully qualified app name.
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "mongo-express.tests.fullname" -}}
 | 
			
		||||
{{- printf "%s-%s" (include "mongo-express.fullname" .) "tests" | trunc 63 | trimSuffix "-" -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
Component labels
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "mongo-express.tests.componentLabels" -}}
 | 
			
		||||
app.kubernetes.io/component: tests
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
Common labels
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "mongo-express.tests.labels" -}}
 | 
			
		||||
{{ include "mongo-express.labels" . }}
 | 
			
		||||
{{ include "mongo-express.tests.componentLabels" . }}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
@@ -0,0 +1,25 @@
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: ConfigMap
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "mongo-express.tests.fullname" . }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "mongo-express.tests.labels" . | nindent 4 }}
 | 
			
		||||
    {{- if .Values.commonLabels }}
 | 
			
		||||
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  annotations:
 | 
			
		||||
    helm.sh/hook: test
 | 
			
		||||
    {{- if .Values.commonAnnotations }}
 | 
			
		||||
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
data:
 | 
			
		||||
  test_all.py: |
 | 
			
		||||
    import requests
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    def test_service_connection():
 | 
			
		||||
        url = "http://{{ include "mongo-express.fullname" . }}:{{ .Values.service.ports.http }}{{ .Values.siteBaseUrl }}"
 | 
			
		||||
 | 
			
		||||
        response = requests.get(url)
 | 
			
		||||
 | 
			
		||||
        assert response.status_code == 200
 | 
			
		||||
							
								
								
									
										30
									
								
								opencloud/charts/mongo-express/templates/tests/pod.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								opencloud/charts/mongo-express/templates/tests/pod.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Pod
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "mongo-express.tests.fullname" . }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "mongo-express.tests.labels" . | nindent 4 }}
 | 
			
		||||
    {{- if .Values.commonLabels }}
 | 
			
		||||
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  annotations:
 | 
			
		||||
    helm.sh/hook: test
 | 
			
		||||
    {{- if .Values.commonAnnotations }}
 | 
			
		||||
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
spec:
 | 
			
		||||
  {{- include "common.images.pullSecrets" ( dict "images" ( list .Values.tests.image ) "global" .Values.global ) | nindent 2 }}
 | 
			
		||||
  containers:
 | 
			
		||||
    - name: tests
 | 
			
		||||
      image: {{ include "common.images.image" ( dict "imageRoot" .Values.tests.image "global" .Values.global ) }}
 | 
			
		||||
      imagePullPolicy: {{ .Values.tests.image.pullPolicy }}
 | 
			
		||||
      volumeMounts:
 | 
			
		||||
        - name: tests
 | 
			
		||||
          mountPath: /tests
 | 
			
		||||
          readOnly: true
 | 
			
		||||
      workingDir: /tests
 | 
			
		||||
  restartPolicy: Never
 | 
			
		||||
  volumes:
 | 
			
		||||
    - name: tests
 | 
			
		||||
      configMap:
 | 
			
		||||
        name: {{ include "mongo-express.tests.fullname" . }}
 | 
			
		||||
		Reference in New Issue
	
	Block a user