faas-provider icon indicating copy to clipboard operation
faas-provider copied to clipboard

Add created / updated into API for sorting / auditing

Open alexellis opened this issue 4 years ago • 4 comments

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.

alexellis avatar Mar 07 '21 17:03 alexellis

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.

jsiebens avatar Mar 11 '21 10:03 jsiebens

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?

alexellis avatar Mar 11 '21 15:03 alexellis

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 avatar Mar 11 '21 15:03 alexellis

@alexellis I think this is done and released in our supported providers.

Waterdrips avatar May 06 '21 07:05 Waterdrips