Skip to content

Secrets Operator 0.10.0 does not support standard Sprig functions anymore #4398

@jscheytt

Description

@jscheytt

Describe the bug

Since Secrets Operator 0.10.0 InfisicalSecret resources that use Sprig templating functions like dict fail. They have worked previously in versions up to 0.9.5.

To Reproduce

Steps to reproduce the behavior:

  1. Install Secrets Operator 0.10.0.
  2. Apply an InfisicalSecret like this:
apiVersion: secrets.infisical.com/v1alpha1
kind: InfisicalSecret
metadata:
  name: example-templating
spec:
  authentication:
    universalAuth:
      secretsScope:
        projectSlug: TODO
        envSlug: dev
        secretsPath: /TODO
      credentialsRef:
        secretName: infisical-universal-auth-credentials
        secretNamespace: infisical-operator-system
  resyncInterval: 300
  managedKubeSecretReferences:
    - secretName: example-templating
      secretNamespace: default
      secretType: kubernetes.io/dockerconfigjson
      template:
        data:
          .dockerconfigjson: |-
            {{- $hostname := "https://registry.gitlab.com" -}}
            {{- $config := dict "auth" (list "username" ":" .GITLAB_REPO_TOKEN.Value | join "" | b64enc) -}}
            {{- dict "auths" (dict $hostname $config) | mustToJson -}}
  1. The status conditions show an error like this:
Failed to sync secrets. This can be caused by invalid access token or an invalid API host that is set.
Error: failed to create managed secret [err=unable to compile template: .dockerconfigjson
[err=template: secret-templates:3: function "dict" not defined]]

Expected behavior

The InfisicalSecret is templated correctly and the Secret is created.

Platform you are having the issue on:

Self-hosted k3s, Infisical EU

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions