remove defer and split into own function
remove defer and split into own function

Change-Id: Icb3baa3b2ab3e24dfe0757f409cf265851ba7b18

coreos/prometheus-operator,jescarri/prometheus-operator,coreos/prometheus-operator,jescarri/prometheus-operator