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

Interpolation in mutation hooks for namespace or other parameters #3377

Open
ajohnstone opened this issue May 9, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@ajohnstone
Copy link

ajohnstone commented May 9, 2024

Describe the solution you'd like
Interpolation in mutation hooks. Is this possible today?

apiVersion: mutations.gatekeeper.sh/v1
kind: Assign
metadata:
  name: demo-dns-config
spec:
  applyTo:
  - groups: [""]
    kinds: ["Pod"]
    versions: ["v1"]
  match:
    scope: Namespaced
    kinds:
    - apiGroups: ["*"]
      kinds: ["Pod"]
  location: "spec.dnsConfig"
  parameters:
    assign:
      value:
        nameservers:
        - 1.2.3.4
        searches:
        - <namespace>.svc.cluster.local
        - svc.cluster.local
        - cluster.local

replace namespace with the namespace in question the mutation for the pod that it is occcurring on.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Gatekeeper version:
  • Kubernetes version: (use kubectl version):
@ajohnstone ajohnstone added the enhancement New feature or request label May 9, 2024
@maxsmythe
Copy link
Contributor

Unfortunately not possible today, but such behavior is compatible with convergence requirement if the values interpolated are immutable (namespace, name)

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

2 participants