{{- if .Values.experimental.localPlugins }}
  {{- range $localPluginName, $localPlugin := .Values.experimental.localPlugins }}
    {{- $pluginType := include "traefik.getLocalPluginType" (dict "plugin" $localPlugin "pluginName" $localPluginName) }}
    {{- if eq $pluginType "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:
  {{- $inlineFiles := include "traefik.getLocalPluginInlineFiles" (dict "plugin" $localPlugin "pluginName" $localPluginName) | fromYaml }}
    {{- range $fileName, $fileContent := $inlineFiles }}
  {{ $fileName }}: |
    {{- $fileContent | nindent 4 }}
      {{- end }}
    {{- end }}
  {{- end }}
{{- end }}
