apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
  name: cache-webhook-${NAMESPACE}
webhooks:
  - name: cache-server.${NAMESPACE}.svc
    clientConfig:
      service:
        name: cache-server
        namespace: ${NAMESPACE}
        path: "/mutate"
      caBundle: ${CA_BUNDLE}
    failurePolicy: Ignore
    rules:
    - operations: [ "CREATE" ]
      apiGroups: [""]
      apiVersions: ["v1"]
      resources: ["pods"]
    sideEffects: None
    timeoutSeconds: 5
    objectSelector:
      matchLabels:
        pipelines.kubeflow.org/cache_enabled: "true"

