Skip to content

Commit

Permalink
add non yaml fixture files
Browse files Browse the repository at this point in the history
  • Loading branch information
xchapter7x committed Oct 20, 2019
1 parent 3945923 commit dac4552
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/commands/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestRenderCommand(t *testing.T) {
for _, control := range tt.contains {
if !strings.Contains(stdOut.String(), control) {
dmp := diffmatchpatch.New()
diffs := dmp.DiffMain(control, stdOut.String(), false)
diffs := dmp.DiffMain(control, stdOut.String(), true)
t.Errorf(
"rendered is wrong:\n%s",
dmp.DiffPrettyText(diffs),
Expand Down
46 changes: 46 additions & 0 deletions pkg/commands/testdata/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

* Concourse can be accessed:

* Within your cluster, at the following DNS name at port:

{{ template "concourse.web.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local


* From outside the cluster, run these commands in the same shell:

export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "concourse.web.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "concourse.web.fullname" . }}'

export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "concourse.web.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "concourse.web.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use Concourse"
kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 8080:
* If this is your first time using Concourse, follow the tutorials at https://concourse-ci.org/tutorials.html


*******************
******WARNING******
*******************

You are using the "naive" baggage claim driver, which is also the default value for this chart.

This is the default for compatibility reasons, but is very space inefficient, and should be changed to either "btrfs" (recommended) or "overlay" depending on that filesystem's support in the Linux kernel your cluster is using.

Please see https://github.com/concourse/concourse/issues/1230 and https://github.com/concourse/concourse/issues/1966 for background.



*******************
******WARNING******
*******************

You're using the default "test" user with the default "test" password.

Make sure you either disable local auth or change the combination to something more secure, preferably specifying a password in the bcrypted form.

Please see 'README.md' for examples.
63 changes: 63 additions & 0 deletions pkg/commands/testdata/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "concourse.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified web node(s) name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "concourse.web.fullname" -}}
{{- $name := default "web" .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified worker node(s) name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "concourse.worker.fullname" -}}
{{- $name := default "worker" .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified postgresql name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "concourse.postgresql.fullname" -}}
{{- $name := default "postgresql" .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "concourse.secret.required" -}}
{{- if .is }}
{{- required (printf "secrets.%s is required because secrets.create is true and %s is true" .key .is) (index .root.Values.secrets .key ) | b64enc | quote }}
{{- else -}}
{{- required (printf "secrets.%s is required because secrets.create is true and %s isn't true" .key .isnt) (index .root.Values.secrets .key ) | b64enc | quote }}
{{- end -}}
{{- end -}}

{{- define "concourse.namespacePrefix" -}}
{{- default (printf "%s-" .Release.Name ) .Values.concourse.web.kubernetes.namespacePrefix -}}
{{- end -}}

{{- define "concourse.are-there-additional-volumes.with-the-name.concourse-work-dir" }}
{{- range .Values.worker.additionalVolumes }}
{{- if .name | eq "concourse-work-dir" }}
{{- .name }}
{{- end }}
{{- end }}
{{- end }}


{{/*
Creates the address of the TSA service.
*/}}
{{- define "concourse.web.tsa.address" -}}
{{- $port := .Values.concourse.web.tsa.bindPort -}}
{{ template "concourse.web.fullname" . }}:{{- print $port -}}
{{- end -}}

0 comments on commit dac4552

Please sign in to comment.