Skip to content

UpdateFailed: pemCertificate function no longer defined #3260

@peterwwillis

Description

@peterwwillis

Describe the bug

When using the examples of Kubernetes TLS certificates here (https://external-secrets.io/latest/guides/common-k8s-secret-types/#tls-cert-example), an error is reported from the ExternalSecret resource:

Events:
  Type     Reason        Age                 From              Message
  ----     ------        ----                ----              -------
  Warning  UpdateFailed  36s (x2 over 37s)   external-secrets  could not apply template: could not execute template: could not execute template: unable to execute template at key tls.key: unable to parse template at key tls.key: template: tls.key:1: function "pemPrivateKey" not defined
  Warning  UpdateFailed  16s (x11 over 37s)  external-secrets  could not apply template: could not execute template: could not execute template: unable to execute template at key tls.crt: unable to parse template at key tls.crt: template: tls.crt:1: function "pemCertificate" not defined

The documentation says pemCertificate no longer needs to be used (https://external-secrets.io/latest/guides/templating/), but I guess it's now a validation error and not just redundant.

My suggestion would be to remove pemCertificate and pemPrivateKey from https://external-secrets.io/latest/guides/common-k8s-secret-types/#tls-cert-example

To Reproduce
Steps to reproduce the behavior:

  1. Create a sample ExternalSecret
  2. Apply it
  3. Check if the new resource validates

Expected behavior
Resource validates

Additional context
Attempting to create an ExternalSecret to create a K8s TLS certificate secret, using example from docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThis issue/Pull Request is stale and will be automatically closedkind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions