Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Excluding original data from templated secret #848

Closed
Amet13 opened this issue Oct 10, 2021 · 4 comments
Closed

Excluding original data from templated secret #848

Amet13 opened this issue Oct 10, 2021 · 4 comments

Comments

@Amet13
Copy link

Amet13 commented Oct 10, 2021

Hey.
Is it possible to exclude source data from generated certificate?

I'm using this templating:

---
apiVersion: kubernetes-client.io/v1
kind: ExternalSecret
metadata:
  name: microservices-repo
  namespace: argo-cd
spec:
  backendType: secretsManager
  data:
    - key: devops-kubernetes-secrets
      name: GITHUB_ORG_TOKEN
  template:
    metadata:
      labels:
        argocd.argoproj.io/secret-type: repository
    stringData:
      url: |
        https://github.com/lalala
      type: |
        git
      password: |
        <%= JSON.parse(data.GITHUB_ORG_TOKEN).GITHUB_ORG_TOKEN %>

I expect to get a secret like:

apiVersion: v1
data:
  password: somebase64=
  type: somebase64==
  url: somebase64==
kind: Secret
metadata:
  name: microservices-repo

But I'm getting:

apiVersion: v1
data:
  GITHUB_ORG_TOKEN: somebase64=
  password: somebase64=
  type: somebase64==
  url: somebase64==
kind: Secret
metadata:
  name: microservices-repo

Wanna exclude this one GITHUB_ORG_TOKEN, but didn't find any docs about it

@Flydiverny
Copy link
Member

No, it does some merging so its always all included :)
If I remember correctly ESO ( https://external-secrets.io/ or https://github.com/external-secrets/external-secrets ) does this differently and only includes the fields in the template if you specify a template.

@Amet13
Copy link
Author

Amet13 commented Oct 12, 2021

Got you. Thanks!

@Amet13 Amet13 closed this as completed Oct 12, 2021
@peter-svensson
Copy link

No, it does some merging so its always all included :) If I remember correctly ESO ( https://external-secrets.io/ or https://github.com/external-secrets/external-secrets ) does this differently and only includes the fields in the template if you specify a template.

I'm looking for this feature as well 😊
Is it something that will be supported in the future or is there something that has been explicitly decided against?

@Flydiverny
Copy link
Member

@peter-svensson
Don't think we made any explicit decision regarding this however if ESO covers your need please see:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants