func (a *UnitAgent) getUpgrader(st *api.State) APIStateUpgrader { if a.apiStateUpgrader != nil { return a.apiStateUpgrader } return st.Upgrader() }