Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nameReference transformer is not updating fields in all configured resource kinds #5504

Open
bodgit opened this issue Jan 2, 2024 · 7 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@bodgit
Copy link

bodgit commented Jan 2, 2024

What happened?

I'm trying to configure the nameReference transformer so it updates the name references in a handful of additional resource kinds using additional configuration. For testing purposes I've configured the nameSuffix transformer to just add -FOOBAR to all of the resource names.

What did you expect to happen?

I would expect all of the configured references to be updated, but only the one referencing the secret name seems to take effect.

A picture paints a thousand words:
image

I can't see what I'm doing wrong, nor is there any sort of error or verbosity knob to tweak.

How can we reproduce it (as minimally and precisely as possible)?

# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - resources.yaml

secretGenerator:
  - name: test
    files:
      - test.pem
    namespace: cert-manager

configurations:
  - kustomizeconfig.yaml

generatorOptions:
  disableNameSuffixHash: true

nameSuffix: -FOOBAR
# resources.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: my-test-sa
  namespace: external-secrets
---
apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
  name: secret-store
spec:
  provider:
    aws:
      service: SecretsManager
      region: eu-west-1
      auth:
        jwt:
          serviceAccountRef:
            name: my-test-sa
            namespace: external-secrets
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: vault
  namespace: cert-manager
spec:
  vault:
    caBundleSecretRef:
      name: test
      key: test.pem
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: cert-manager-vault-approle
  namespace: cert-manager
spec:
  secretStoreRef:
    name: secret-store
    kind: ClusterSecretStore
# kustomizeconfig.yaml
nameReference:
  - kind: Secret
    fieldSpecs:
      - kind: ClusterIssuer
        group: cert-manager.io
        path: spec/vault/caBundleSecretRef/name
  - kind: ServiceAccount
    fieldSpecs:
      - kind: ClusterSecretStore
        group: external-secrets.io
        path: spec/provider/aws/auth/jwt/serviceAccountRef/name
  - kind: ClusterSecretStore
    group: external-secrets.io
    fieldSpecs:
      - kind: ExternalSecret
        group: external-secrets.io
        path: spec/secretStoreRef/name
# test.pem
Cg==

Expected output

apiVersion: v1
kind: ServiceAccount
metadata:
  name: my-test-sa-FOOBAR
  namespace: external-secrets
---
apiVersion: v1
data:
  test.pem: Q2c9PQo=
kind: Secret
metadata:
  name: test-FOOBAR
  namespace: cert-manager
type: Opaque
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: vault-FOOBAR
  namespace: cert-manager
spec:
  vault:
    caBundleSecretRef:
      key: test.pem
      name: test-FOOBAR
---
apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
  name: secret-store-FOOBAR
spec:
  provider:
    aws:
      auth:
        jwt:
          serviceAccountRef:
            name: my-test-sa-FOOBAR
            namespace: external-secrets
      region: eu-west-1
      service: SecretsManager
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: cert-manager-vault-approle-FOOBAR
  namespace: cert-manager
spec:
  secretStoreRef:
    kind: ClusterSecretStore
    name: secret-store-FOOBAR

Actual output

apiVersion: v1
kind: ServiceAccount
metadata:
  name: my-test-sa-FOOBAR
  namespace: external-secrets
---
apiVersion: v1
data:
  test.pem: Q2c9PQo=
kind: Secret
metadata:
  name: test-FOOBAR
  namespace: cert-manager
type: Opaque
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: vault-FOOBAR
  namespace: cert-manager
spec:
  vault:
    caBundleSecretRef:
      key: test.pem
      name: test-FOOBAR
---
apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
  name: secret-store-FOOBAR
spec:
  provider:
    aws:
      auth:
        jwt:
          serviceAccountRef:
            name: my-test-sa
            namespace: external-secrets
      region: eu-west-1
      service: SecretsManager
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: cert-manager-vault-approle-FOOBAR
  namespace: cert-manager
spec:
  secretStoreRef:
    kind: ClusterSecretStore
    name: secret-store

Kustomize version

5.3.0

Operating system

Linux

@bodgit bodgit added the kind/bug Categorizes issue or PR as related to a bug. label Jan 2, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 2, 2024
@bodgit bodgit changed the title nameReference transformer is not updating fields in all configurated resource kinds nameReference transformer is not updating fields in all configured resource kinds Jan 2, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 1, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 1, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

@k8s-ci-robot k8s-ci-robot closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@stormqueen1990
Copy link
Member

stormqueen1990 commented May 31, 2024 via email

@k8s-ci-robot k8s-ci-robot reopened this May 31, 2024
@k8s-ci-robot
Copy link
Contributor

@stormqueen1990: Reopened this issue.

In response to this:

/reopen
/lifecycle frozen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants