mayadata-io / d-operators

Declarative patterns to write kubernetes controllers
Apache License 2.0
10 stars 7 forks source link

extract & register value(s) in a declarative way #3

Open AmitKumarDas opened 4 years ago

AmitKumarDas commented 4 years ago

Figure out a way/approach to extract value from specific fields in a declarative manner.

One of the approaches that we might want to follow is to find the diff of the declared indent against the actual specifications. We might probably be able to get the specific field's actual value by comparing it against a dummy value.

For example for following declaration, we should be able to find the actual status.phase value of my-pod:

kind: Pod
apiVersion: v1
metadata:
  name: my-pod
status:
  phase: extract-n-register

References:

Alternative

Use jsonnet to do all of the above. Weigh in the pros & cons & proceed. Jsonnet as a controller needs to be supported any way.

AmitKumarDas commented 4 years ago

Current Thought Process