Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/cover.out.tmp
/coverage.log
.vscode
.idea
4 changes: 4 additions & 0 deletions charts/model-csi-driver/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ data:
service_name: {{ .Values.config.serviceName }}
root_dir: {{ .Values.config.rootDir }}
csi_endpoint: unix:///csi/csi.sock
{{- with .Values.config.pullConfig }}
pull_config:
{{- toYaml . | nindent 6 }}

Choose a reason for hiding this comment

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

critical

The whitespace control {{- will remove the preceding newline and spaces. This will cause pull_config: and its content to be rendered on the same line, resulting in invalid YAML. To fix this, you should remove the - from {{-.

For cleaner formatting, you might also consider using indent instead of nindent and adjusting the template structure, but removing the - is the critical fix.

      {{ toYaml . | nindent 6 }}

Copy link
Author

@rayne-Li rayne-Li Jan 16, 2026

Choose a reason for hiding this comment

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

  • run helm template good with {{ - }}
image
# helm template model-csi-driver ./model-csi-driver -f model-spec/values-custom.yaml
kind: ConfigMap
metadata:
  name: config
  namespace: model-csi
data:
  config.yaml: |-
    service_name: model.csi.modelpack.org
    root_dir: /mnt/data01/dragonfly/model-csi
    csi_endpoint: unix:///csi/csi.sock
    pull_config:
      concurrency: 32
      dragonfly_endpoint: unix:////var/run/dragonfly/dfdaemon.sock
  • an empty line will be added if remove {{ - }}
# Source: model-csi-driver/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: config
  namespace: model-csi
data:
  config.yaml: |-
    service_name: model.csi.modelpack.org
    root_dir: /mnt/data01/dragonfly/model-csi
    csi_endpoint: unix:///csi/csi.sock
    pull_config:
      
      concurrency: 32
      dragonfly_endpoint: unix:////var/run/dragonfly/dfdaemon.sock

{{- end }}
4 changes: 4 additions & 0 deletions charts/model-csi-driver/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ spec:
{{- if .Values.hostNetwork }}
hostNetwork: {{ .Values.hostNetwork }}
{{- end }}
{{- if .Values.hostAliases }}
hostAliases:
{{- toYaml .Values.hostAliases | nindent 6 }}
{{- end }}
containers:
- name: model-csi-driver-registrar
image: "{{ .Values.registrar.image.repository }}:{{ .Values.registrar.image.tag }}"
Expand Down
18 changes: 18 additions & 0 deletions charts/model-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ config:
# registry.example.com:
# auth: dXNlcm5hbWU6cGFzc3dvcmQ=
# serverscheme: https
# pullConfig:
# # Number of concurrent downloads.
# concurrency: 5
#
# # Path to the directory containing Docker config.json file.
# # Defaults to /root/.docker
# docker_config_dir: ""
#
# # Endpoint of the Dragonfly dfdaemon.
# # e.g. unix:////var/run/dragonfly/dfdaemon.sock
# dragonfly_endpoint: ""
#
# # URL of a proxy server to use for pulling images.
# proxy_url: ""
#
# # Timeout in seconds for pulling a single layer.
# pull_layer_timeout_in_seconds: 300

namespace: model-csi

Expand Down Expand Up @@ -46,3 +63,4 @@ podAnnotations: {}
nodeSelector: {}
tolerations: []
affinity: {}
hostAliases: {}