-
Notifications
You must be signed in to change notification settings - Fork 799
feat(plugins): support ConfigMap inline local plugins alongside hostPath #1492
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
base: master
Are you sure you want to change the base?
Changes from 13 commits
9ba5bdf
278c337
4a43f73
12bf0a2
552cffa
b6df316
0826e5d
1ddb67e
dfaa36d
bc2af2f
1945596
959cf65
bd92882
eb1cfaf
a7d0639
b33f4f5
4d31c24
da1b2e3
1a03526
24fa2cb
f7603c7
b6fce53
5dd9f84
1878378
38924a7
53c6eb9
14bb9e7
d284e50
1d95811
5314ae9
6ef72eb
d8c2c91
0d5b2a0
da6fa84
380a308
c7c10c0
a63f783
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -261,6 +261,10 @@ Hash: {{ sha1sum ($cert.Cert | b64enc) }} | |||||
| {{- end -}} | ||||||
| {{- end -}} | ||||||
|
|
||||||
| {{- define "traefik.localPluginCmName" -}} | ||||||
| {{ include "traefik.fullname" .context }}-local-plugin-{{ .pluginName | replace "." "-" }} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| {{- end -}} | ||||||
|
|
||||||
| {{- define "traefik.hasPluginsVolume" -}} | ||||||
| {{- $found := false -}} | ||||||
| {{- range . -}} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -943,8 +943,15 @@ | |
| {{- end }} | ||
| {{- range $localPluginName, $localPlugin := .Values.experimental.localPlugins }} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find the ordering of volumes a bit weird looking at it now; probably the plugin-related volumes, i.e. this range and the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Later on, I'm happy to work on this in a separate PR. |
||
| - name: {{ $localPluginName | replace "." "-" }} | ||
| {{- if $localPlugin.hostPath }} | ||
| hostPath: | ||
| path: {{ $localPlugin.hostPath | quote }} | ||
| {{- else if $localPlugin.inlinePlugin }} | ||
|
||
| configMap: | ||
| name: {{ include "traefik.localPluginCmName" (dict "context" $ "pluginName" $localPluginName) }} | ||
| {{- else }} | ||
| {{- fail (printf "ERROR: local plugin %s must specify either hostPath or inlinePlugin!" $localPluginName) }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- if and (gt (len .Values.experimental.plugins) 0) (ne (include "traefik.hasPluginsVolume" .Values.deployment.additionalVolumes) "true") }} | ||
| - name: plugins | ||
|
|
||
jnoordsij marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| {{- if .Values.experimental.localPlugins }} | ||
| {{- range $localPluginName, $localPlugin := .Values.experimental.localPlugins }} | ||
| {{- if $localPlugin.inlinePlugin }} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "traefik.localPluginCmName" (dict "context" $ "pluginName" $localPluginName) }} | ||
| namespace: {{ template "traefik.namespace" $ }} | ||
| labels: | ||
| {{- include "traefik.labels" $ | nindent 4 }} | ||
| data: | ||
| {{- range $fileName, $fileContent := $localPlugin.inlinePlugin }} | ||
| {{ $fileName }}: | | ||
| {{- $fileContent | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} |
Uh oh!
There was an error while loading. Please reload this page.