// SetCondition adds/replaces the given condition in the replication controller status. func SetCondition(status *api.ReplicationControllerStatus, condition api.ReplicationControllerCondition) { currentCond := GetCondition(*status, condition.Type) if currentCond != nil && currentCond.Status == condition.Status && currentCond.Reason == condition.Reason { return } newConditions := filterOutCondition(status.Conditions, condition.Type) status.Conditions = append(newConditions, condition) }
// RemoveCondition removes the condition with the provided type from the replication controller status. func RemoveCondition(status *api.ReplicationControllerStatus, condType api.ReplicationControllerConditionType) { status.Conditions = filterOutCondition(status.Conditions, condType) }