water-hole / ansible-operator

POC Code for the operator backed by ansible
48 stars 29 forks source link

Moves ResourceStatus and related code to the handler package. #35

Closed mhrivnak closed 6 years ago

mhrivnak commented 6 years ago

ResourceStatus represents the Status field on a CR. Everything in types.go relates to the CR's status, and not directly to the act of running ansible. Code in runner/types.go was only being used from within handler/handler.go, which is a good indicator that the code should be moved.

A reasonable boundary is to let the runner package handle execution of ansible, and let it return information about that run (in the form of a StatusJobEvent). The caller (which is in the handler package) can then take that information and do whatever is appropriate with it.