I think the most readable pattern for functions that accept k8s objects as arguments is to accept them by reference (in order to save memory and slightly improve performance), but if the func modifies the object then it must explicitly return it. For example:
I think the most readable pattern for functions that accept k8s objects as arguments is to accept them by reference (in order to save memory and slightly improve performance), but if the func modifies the object then it must explicitly return it. For example:
Not So Good:
Better:
We have not checked the lib code for this pattern but recommend that the next owner do so.