gatekeeper icon indicating copy to clipboard operation
gatekeeper copied to clipboard

Provide a way to define multiple value for the same location in AssignMetadata

Open strus38 opened this issue 2 years ago • 4 comments

Describe the solution you'd like I would like to be able to define multiple values for the same location when using AssignMetadata, like this:

apiVersion: mutations.gatekeeper.sh/v1alpha1
kind: AssignMetadata
metadata:
  name: jobs-ingress-annotation
  namespace: gatekeeper-system
spec:
  match:
    scope: Namespaced
    kinds:
      - apiGroups: ["*"]
        kinds: ["Ingress"]
    namespaces: ["system-jobs"]
  location: metadata.annotations
  parameters:
    assign:
      value:
        test/input1: tsmcx-isser
        test/input2: tsmcx-isser
        test/input3: tsmcx-isser
        test/input4: tsmcx-isser

This would save the amount of code to write, and having to define those individually.

Anything else you would like to add: It would be also handy to be able to provide key word to be reused from the same object, here this value: spec.rules.http.paths.backend.service.name

apiVersion: mutations.gatekeeper.sh/v1alpha1
kind: AssignMetadata
metadata:
  name: jobs-ingress-annotation
  namespace: gatekeeper-system
spec:
  match:
    scope: Namespaced
    kinds:
      - apiGroups: ["*"]
        kinds: ["Ingress"]
    namespaces: ["system-jobs"]
  location: metadata.annotations.test/input1
  parameters:
    assign:
      value: { spec.rules.http.paths.backend.service.name }

Thanks.

strus38 avatar Nov 28 '21 11:11 strus38

Thanks for the feedback! This sounds like it may be similar to the functionality mentioned in #1348

maxsmythe avatar Nov 30 '21 02:11 maxsmythe

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 23 '22 02:07 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 11 '22 05:10 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 12 '22 12:12 stale[bot]