Skip to content

Commit

Permalink
Let's tests shared cluster on Helm Charts first
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <[email protected]>
  • Loading branch information
phracek committed Oct 16, 2024
1 parent 0aa343c commit 31ba1d2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
9 changes: 9 additions & 0 deletions charts/redhat/httpd-template/src/templates/buildconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ metadata:
template: httpd-example
name: {{ .Values.name }}
spec:
{{ if .Values.registry.enabled }}
output:
to:
kind: DockerImage
name: "{{ .Values.registry.name }}/{{ .Values.registry.namespace }}/{{ .Values.name }}:latest"
pushSecret:
name: images-paas-push-config
{{ else }}
output:
to:
kind: ImageStreamTag
name: {{ .Values.name }}:latest
{{ end }}
source:
contextDir: {{ .Values.context_dir }}
git:
Expand Down
6 changes: 6 additions & 0 deletions charts/redhat/httpd-template/src/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
description: Defines how to deploy the application server
template.alpha.openshift.io/wait-for-ready: "true"
image.openshift.io/triggers: |-
{{ if not .Values.registry.enabled }}
[
{
"from": {
Expand All @@ -14,6 +15,7 @@ metadata:
"fieldPath": "spec.template.spec.containers[0].image"
}
]
{{ end}}
labels:
app: httpd-example
template: httpd-example
Expand All @@ -33,7 +35,11 @@ spec:
spec:
containers:
- env: []
{{ if .Values.registry.enabled }}
image: "{{ .Values.registry.name }}/{{ .Values.registry.namespace }}/{{ .Values.name }}:latest"
{{ else }}
image: " "
{{ end }}
livenessProbe:
httpGet:
path: /
Expand Down
8 changes: 8 additions & 0 deletions charts/redhat/httpd-template/src/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
"context_dir": {
"type": "string",
"description": "Set this to the relative path to your project if it is not in the root of your repository."
},
"name": {
"type": "string",
"description": "The name of registry that will be used for pushing built image."
},
"namespace": {
"type": "string",
"description": "The namespace of registry that will be used for pushing built image."
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions charts/redhat/httpd-template/src/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ namespace: openshift
source_repository_ref: master # TODO: must define a default value for .source_repository_ref
source_repository_url: https://github.com/sclorg/httpd-ex.git
expected_str: Welcome to your static httpd application on OpenShift
registry:
enabled: false
name: "quay.io"
namespace: "something"
3 changes: 2 additions & 1 deletion tests/test_httpd_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def test_package_persistent_by_helm_chart_test(self):
assert self.hc_api.helm_installation(
values={
"httpd_version": "2.4-el8",
"namespace": self.hc_api.namespace
"namespace": self.hc_api.namespace,
"name": "httpd-example"
}
)
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="httpd-example")
Expand Down

0 comments on commit 31ba1d2

Please sign in to comment.