tako icon indicating copy to clipboard operation
tako copied to clipboard

Re-visit restart policy and equivalent

Open mangas opened this issue 4 years ago • 0 comments

Restart policy is now split between 2 places:

https://github.com/appvia/kev/blob/5a1c05c568427024fb3ef76a9fc0a5d6bdd1e341/pkg/kev/config/extensions.go#L187 https://github.com/appvia/kev/blob/5a1c05c568427024fb3ef76a9fc0a5d6bdd1e341/pkg/kev/converter/kubernetes/project_service.go#L408

and some really inconvenient assertions (IMO) https://github.com/appvia/kev/blob/5a1c05c568427024fb3ef76a9fc0a5d6bdd1e341/pkg/kev/converter/kubernetes/project_service_test.go#L1052

A better way in my view would be to ensure all the logic for restart policy gets moved to extensions.go and that a type of errors gets introduced (e.g ErrUnsupportedRestartPolicy). This makes the separation between presentation and validation by making it possible to assert the error occurred and moving the output handling to the UI.

mangas avatar Apr 29 '21 12:04 mangas