metacontroller icon indicating copy to clipboard operation
metacontroller copied to clipboard

Allow selecting DecoratorController objects by field selector

Open grantr opened this issue 6 years ago • 1 comments

DecoratorController can already select objects by label selector and annotation selector. It would be convenient to select objects by field value as well.

An example is the schedulerName field allowing a Pod resource to specify an alternate scheduler for itself. Here's a DecoratorController that acts only on Pods specifying the foo scheduler:

apiVersion: metacontroller.k8s.io/v1alpha1
kind: DecoratorController
metadata:
  name: foo-pods
spec:
  resources:
  - apiVersion: v1
    resource: pods
    fieldSelector:
      matchExpressions:
      - {key: spec.schedulerName, operator: In, values: [foo]}

grantr avatar Oct 03 '18 18:10 grantr

Oooh I like that!

enisoc avatar Oct 17 '18 00:10 enisoc