pulumi / pulumi-kubernetes

A Pulumi resource provider for Kubernetes to manage API resources and workloads in running clusters
https://www.pulumi.com/docs/reference/clouds/kubernetes/
Apache License 2.0
406 stars 115 forks source link

Chart v4 fails to handle an array of assets #3060

Closed EronWright closed 3 months ago

EronWright commented 3 months ago

What happened?

Chart v4 supports the use of assets as chart values, for example to populate the extraDeploy parameter (which takes an array of yaml manifests) of a Bitnami chart. For some reason, the value isn't used as expected.

Example

Pulumi.yaml:

resources:
  cert-manager:
    type: kubernetes:helm.sh/v4:Chart
    properties:
      namespace: cert-manager
      chart: oci://registry-1.docker.io/bitnamicharts/cert-manager
      version: "1.3.1"
      values:
        extraDeploy:
        - fn::fileAsset: manifest.yaml

manifest.yaml:

{{- define "certmanager.extra.fullname" -}}
{{- printf "%s-extra" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "certmanager.extra.fullname" . }}
  namespace: {{ .Release.Namespace | quote }}
  labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
    app.kubernetes.io/component: extra
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}

If you run this example, we expect to see a ConfigMap named cert-manager-extra in the set of child resources, as defined by the manifest.

Output of pulumi about

❯ p about
CLI          
Version      3.117.0
Go Version   go1.22.3
Go Compiler  gc

Plugins
KIND      NAME        VERSION
resource  kubernetes  unknown
language  yaml        unknown

Host     
OS       darwin
Version  14.4.1
Arch     arm64

Additional context

The root cause seems to be that values of type array aren't processed correctly.

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

pulumi-bot commented 2 months ago

This issue has been addressed in PR #3061 and shipped in release v4.14.0.