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

Allow implicit namespace resolution in apply-time-mutation #4098

Open
b1zzu opened this issue Dec 3, 2023 · 0 comments
Open

Allow implicit namespace resolution in apply-time-mutation #4098

b1zzu opened this issue Dec 3, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@b1zzu
Copy link

b1zzu commented Dec 3, 2023

I would like to create packages with config.kubernetes.io/apply-time-mutation that are independent of the namespace they are going to be deployed in.

Example:

Given this configuration:

apiVersion: v1
kind: ConfigMap
metadata:
  name: test-b
  annotations:
    config.kubernetes.io/apply-time-mutation: |
      - sourceRef:
          kind: ConfigMap
          name: test-a
        sourcePath: $.data.src
        targetPath: $.spec.dest
        token: ${value}
data:
  dest: "${value}-bar"
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: test-a
data:
  src: "foo"

when applying it to the cluster it fails with the following error:

error: invalid object: "default_test-b__ConfigMap": invalid "config.kubernetes.io/apply-time-mutation" annotation: external dependency: /namespaces/default/ConfigMap/test-b -> /ConfigMap/test-a

and force me to explicitly define the namespace of the source resources making the package impossible to reuse in different namespaces.

@b1zzu b1zzu added the enhancement New feature or request label Dec 3, 2023
@github-project-automation github-project-automation bot moved this to Backlog in kpt Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant