faas-provider
faas-provider copied to clipboard
Add created / updated into API for sorting / auditing
Schema change
Add created / updated into API for sorting / auditing
I had a use-case where I wanted to sort the functions by time created, and I couldn't find a way to do that with the function spec. This could also be useful for auditing purposes.
faas-netes
This is available in the Deployment spec already
faasd
The container creation date is probably available, but there isn't a way to update a container without re-creating it, so the created and modified dates would be the same.
for faas-netes: a creation timestamp is available in the Deployment spec, but a modification date is not. Unless we drill down in the status part of the Deployment spec.
Related: https://github.com/kubernetes/kubernetes/issues/12430
For the time being, CreatedAt time.Date would be sufficient for sorting and can be added whilst we consider if modified date is worth the additional custom work.
As a side-note, it looks like containerd does have an updated at
i,err:= c.Info(context.Background())
i.CreatedAt
i.UpdatedAt
@jsiebens to prevent duplicated work, are you taking this?
To unblock folks so they can start with faasd and faas-netes, and because nobody has volunteered to take the schema change yet, I've gone ahead and added a field for CreatedAt and cut a release. https://github.com/openfaas/faas-provider/releases/tag/v0.17.2
Please feel free to populate in faasd + faas-netes in separate PRs.
@alexellis I think this is done and released in our supported providers.