Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Improve configmap with helm #15825

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions deploy/kubernetes/helm/che/templates/_configMapHelper.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- define "properties" -}}
{{- range $key, $value := . -}}
{{- $key | upper | replace "_" "__" | nindent 2 -}}
tolusha marked this conversation as resolved.
Show resolved Hide resolved
{{- template "travarsalProperty" . }}
{{- end -}}
{{- end -}}
{{- define "travarsalProperty" -}}
{{- if (eq (kindOf .) "map") -}}
_ {{- template "_properties" . -}}
{{- else -}}
{{- printf ": %s" (quote .) -}}
{{- end -}}
{{- end -}}
{{- define "_properties" -}}
{{- range $key, $value := . -}}
{{- $key | upper | replace "_" "__" -}}
{{- template "travarsalProperty" . -}}
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions deploy/kubernetes/helm/che/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ metadata:
component: che
name: che
data:
{{- template "properties" .Values.che.properties }}
CHE_HOST: {{ template "cheHost" . }}
CHE_PORT: "8080"
{{- if and .Values.global.tls .Values.global.tls.enabled }}
Expand Down
3 changes: 3 additions & 0 deletions deploy/kubernetes/helm/che/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ global:
chePluginRegistryUrlFormat: "plugin-registry-%s.%s"

che:
properties:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not ?
properties: {}

Copy link
Member Author

@monaka monaka Jan 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix was applied by da9c72d and its comment is:

This is just a example for discussing configMapHelper. Do not apply this patch to the master branch.

That commit is just for explaining the usage. It must be reverted before merged.
I agree properties: {} will be the best choice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monaka
Could you pls fix that? I would like to merge the PR )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tolusha Thanks for heads up. I found a minor bug in this PR.
I'll fix it within a few days and will re-request review.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monaka
Can we helm with anything?

che:
foo_bar_baz: 3
workspace: {}
# devfileRegistryUrl: "https://che-devfile-registry.openshift.io/"
# pluginBroker:
Expand Down