You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the great library. It's a pleasure to work with.
Problem
I have a custom resource with an array of objects somewhere in the spec. Say, like this:
spec:
a:
b:
- foo: loremnested:
bar: ipsum
- foo: dolornested:
bar: sit
I would like to be able to use @kopf.on.update to watch on individual changes of fields within array items and have these changes automatically in the diff argument of the handler.
The case at hand: I use kopf to build an operator that will create multiple StatefulSets where some specs for the StatefulSets are defined in the custom resource, such as the number of replicas:
An interesting question in the last context would be how adding / removing items is going to be handled. E.g., what would the diff look like if one were to add a type-c as first item in the array and remove the type-b:
Thank you for the great library. It's a pleasure to work with.
Problem
I have a custom resource with an array of objects somewhere in the spec. Say, like this:
I would like to be able to use
@kopf.on.update
to watch on individual changes of fields within array items and have these changes automatically in thediff
argument of the handler.The case at hand: I use kopf to build an operator that will create multiple StatefulSets where some specs for the StatefulSets are defined in the custom resource, such as the number of replicas:
The feature would allow me to neatly detect when the replicas for
type-a
are changed to e.g. 3.Proposal
I see a few different implementation options. I'll demonstrate them here:
Alternatively, one could want to watch for changes to the n-th array item in
@kopf.on.field
:Or watch for each array element and get its index.
An interesting question in the last context would be how adding / removing items is going to be handled. E.g., what would the diff look like if one were to add a
type-c
as first item in the array and remove thetype-b
:Checklist
The text was updated successfully, but these errors were encountered: