Conversation
| } | ||
| } | ||
|
|
||
| func ConfigObjectResultWithField(msg string, obj *KubeObject, severity Severity, field *Field) *Result { |
There was a problem hiding this comment.
I am hoping this function can be smarter: user provides the field path and proposedValue, it can find out the currentValue from the path, determining the right type, and validate the proposedValue field
Also. ln304-317 can be simplified by calling ConfigObjectResult
There was a problem hiding this comment.
I think it is difficult to have a path and determine its currentValue, the path might contain a slice. How should I represent the slice using path? Should I add [] in the path?
Since I am hard coding the path inside my new transformer, I know in advance if this field is a slice or not. How should I convey this message to ConfigObjectResultWithField? For the cases with AdditionalLabelFields, it uses [] to indicate a slice.
There was a problem hiding this comment.
Suggest reading the KRM function specification as I mentioned in last 1:1.
Path is the JSON path of the field e.g. spec.template.spec.containers[3].resources.limits.cpu
There was a problem hiding this comment.
On second thought, this is suppose to use when logging results. All the results should be updated before the logging. There is no point getting currentValue using path @yuwenma . In implementation, the old value and new value are stored in some map, then later used in the logging.
To log results in
Runnerinterface, current method does not supplyFieldstruct, add a new method that logsFieldas well.